Improvement #669
openDefault fallback allocator
0%
Description
Right now the default allocators for smaller target is a very simple bump allocator
with no possibility to reclaim memory.
I searched a bit for other options and found a possible replacement which is small
enough to even be used for systems with a few tens of KB of RAM.
The allocator is called TLSF (Two-Level Segregate Fit) and is a relative new development
which has attractive properties for smaller systems and the code size in the range of 500 to 1000 LOC.
Webpage : http://www.gii.upv.es/tlsf/index.html
Paper : http://www.gii.upv.es/tlsf/files/papers/ecrts04_tlsf.pdf
Independent implementation : https://github.com/mattconte/tlsf
An independent implementation can be done from the paper if the license is a problem.
Other alternative simple solutions with linear scanning free lists have problems with
overhead for the smallest systems and fragmentation.
Files
Updated by Florian Negele about 1 year ago
- Priority changed from Normal to Low
Thanks for the interesting read. Memory allocation is a low priority at the moment but we will keep an eye on this.
Updated by Runar Tenfjord about 1 year ago
- File Std.SysMem.mod Std.SysMem.mod added
The attached allocator in Oberon seems to do the job and is tested on armt32.
This allocator is implemented as an embedded free list allocator and is original
sourced from "The C Programming Language", Page 173.
Ref also : https://stackoverflow.com/a/36512105/10830469
This is ofcourse the simplest possible implementation and the above reference
TLSF type allocator is probably a better choice.