an MLib memory pool is a fast memory allocator
for fixed-size blocks.
note that the reason why memory pools are so fast
is due to two facts: first, blocks are allocated
in batches from the heap. Second, once allocated,
a block will never be released to the heap until
the pool itself is destroyed.
never forget that modern implementations of the
standard "malloc" and "free" functions are
already very fast. Using memory pools is really
handy when you want to absolutely reduce
fragmentation, and need to perform _lots_ of
consecutive allocs and frees..
the MLib uses memory pools to manage list nodes,
hash nodes, tree nodes and other frequently used
fixed-sized objects..
|