Conversation

Replying to and
Let's start with the definition of "hard realtime" here. "hard realtime" means that there is an upper bound on the execution of an operation. It says nothing about the absolute latency. malloc() in C is a good example. It's usually pretty quick, but it is not realtime.
2
Replying to
They all traverse a list of free chunks to find the next one that's big enough to satisfy the allocation. I once was paid to write the realtime control software for an atomic force microscope. I know that stuff well enough.
2
Replying to
No, they have separate lists per size class, thus no need to traverse. The first entry is always valid. This is somewhat size-inefficient if you allow a range of sizes in each class, and split/merge free zones, but it's usually a good tradeoff, & perfect with fixed-size classes.
1
1
The size class approach with dedicated slabs works well in practice and expanding to larger sizes via the jemalloc class scheme is quite cheap. Segregated fit is okay for larger allocations but O(log n) precise address ordered best-fit causes significantly less fragmentation.
1
LIFO lists of partially filled and empty slabs with LIFO free lists within them is also just one design choice. Bitmaps have advantages like naturally doing address order packing and not needing to touch as much often cold memory on free. Lots of allocators use a mix of these.
1
1
Show replies