Skip to content

silentbicycle/mpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A memory pool allocator, designed for systems that need to allocate/free
pointers in amortized O(1) time. Memory is allocated a page at a time,
then added to a set of pools of equally sized regions. A free list for
each size is maintained in the unused regions. When a pointer is
repooled, it is put at the head of the appropriate free list.

Allocations larger than mp->max_pool (configurable, usually over 2048
bytes) are allocated whole via mmap and freed immediately via munmap; no
free list is used.

For example usage, see test.c.

About

memory pool allocator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages