Reference: BMEM (block memory)
General
BMEM provides block memory functionality
for those situations where it's necessary to allocate many homogenous structures.
It provides significantly higher performance than alternative methods, see
the benchmarks for more information.
- BMEM
*bmem_new(size_t block_size);
Creates a new memory area that will return blocks of size block_size.
- void
bmem_del(BMEM *mem);
Destroys memory area specified by mem and frees
all blocks associated with it.
- void
*bmem_block_new(BMEM *mem);
Returns an available block from memory area specified by mem.
- void
bmem_block_del(BMEM *mem, void *block);
Puts the given block back into the memory area.
|