3 ms·
What's the difference between this and a slab allocator? Is it just that the bin size distribution wastes less memory (assuming the slab allocator used pow2 bin
by widdershins 2y ago
What's the difference between this and a slab allocator? Is it just that the bin size distribution wastes less memory (assuming the slab allocator used pow2 bin sizes)?
- hinkley 2y agoSlab allocators don’t provide real time guarantees. That is arena allocators. The distinction may seem trivial but the requirements are distinct. In tiny systems all allocations of one type may come from a single operation, but in larger systems what fits in a slab will come from distinct concerns with different priorities. You want a different arena for those allocations.
- widdershins 2y agoI'm confused. To me it seems that real time guarantees are a function of three things: - Is it constant time in algorithmic complexity? - Is it single threaded (i.e. free from locks)? - Does it need to fetch memory from the system (not realtime safe)? There are slab allocators that can satisfy all of these, and are therefore realtime safe. So I'm still wondering what the difference is.