#include <stdlib.h>#include "mb_tools.h"Go to the source code of this file.
Classes | |
| struct | _elmpool |
| Small fixed size data elements management. More... | |
Functions | |
| elmpool_t * | elmpool_new (int elm_sz, int inc_num) |
| Create a new data elements pool. | |
| void * | elmpool_elm_alloc (elmpool_t *pool) |
| void | elmpool_elm_free (elmpool_t *pool, void *elm) |
| void | elmpool_free (elmpool_t *pool) |
| elmpool_t* elmpool_new | ( | int | elm_sz, | |
| int | inc_num | |||
| ) |
Create a new data elements pool.
elmpool_t provide a pool of fixed size elements to gain better utilization of memory. It try to allocate bigger memory blocks for multiple elements.
| elm_sz | size of elements. | |
| inc_num | is number of elments to allocate every time. (>= 16) |