- Parameters
-
objcnt | The number of elements in the mempool. The optimum size (in terms of memory usage) for a mempool is when n is a power of two minus one: n = (2^q - 1). |
objsz | The size of each element. |
cache_sz | Size of the for the mempool |
addr | The address to the start of the mempool. If the addr is NULL then it will be allocated from the system memory and freed when the mempool is destroyed. |
mp_init | A function pointer that is called for initialization of the pool, before object initialization. This parameter can be NULL if not needed. |
mp_init_arg | An opaque pointer to data that can be used in the mempool constructor function. |
obj_init | A function pointer that is called for each object at initialization of the pool. The user can set some meta data in objects if needed. This parameter can be NULL if not needed. The obj_init() function takes the mempool pointer, the init_arg, the object pointer and the object number as parameters. |
obj_init_arg | An opaque pointer to data that can be used as an argument for each call to the object constructor function. |
Definition at line 92 of file mempool.h.