Hacker News new | ask | show | jobs
by dimonomid 3799 days ago
For the system that allocates just once at startup, I can't think of any noticeable change of performance even if allocator is 20 times slower. But, it should be memory-efficient, since RAM is really expensive on those devices, isn't it?

Standard allocators that I'm familiar with use minimum 8 bytes overhead per allocation. Umm_malloc uses 4 bytes overhead: twice less. If we have 200 allocations, it's 800 wasted bytes already.

Plus, it uses "best-fit" algorithm, so that the resulting fragmentation is far less than with the "first-fit", which is used in standard allocators. (if one really wants to, she can use "first-fit" on umm_malloc, too)

1 comments

You also want to minimize Flash usage/code size; if your microcontroller has 8KB Flash, a more complex allocator might not be the best use of that Flash. Especially if you've got a allocate-once pattern.