Memory Pools (mpool) are heap style objects that may be created on top of statically defined memory areas or by using memory pages obtained dynamically from the operating system. Standard heap type operations such as allocate, reallocate, and free are supported. An mpool may be created or destroyed at any time. Destroying an mpool is predicated upon no further references to mpool memory being possible.
This lists common operations related to memory pools and the INtime system calls that do the operations.
To . . . | Use this system call . . . |
---|---|
Add a memory chunk to a memory pool | mpool_add_chunk |
Allocate a new buffer from a memory pool | mpool_alloc |
Return the current number of buffers created by mpool_alloc/mpool_realloc | mpool_buffer_cnt |
Return the size of a buffer returned by mpool_alloc or mpool_realloc | mpool_buffer_size |
Check the memory pool for internal consistency | mpool_check |
Return to the operating system pages of memory freed via mpool_free and no longer in use | mpool_compact |
Create a memory pool and return a handle to it | mpool_create |
Delete a memory pool and free all its resources | mpool_delete |
Dump memory pool statistics and lists to the console or to a file | mpool_dump |
Free a buffer allocated with mpool_alloc or mpool_realloc | mpool_free |
Get a pool's configuration | mpool_get_config |
Retrieve the name associated with a pool | mpool_pool2name |
Retrieve the pool associated with a buffer | mpool_ptr2pool |
Change the size of a buffer allocated with mpool_alloc or mpool_realloc | mpool_realloc |
Restore a pool to its creation state | mpool_reset |
Set pool configuration | mpool_set_config |
Get the memory pool's statistics | mpool_stats |
Reset pool statistics | mpool_stats_reset |
Determine whether the buffer address is valid and exists within a pool buffer | mpool_validate_buffer |