Native QF Memory Pool. More...
#include "qmpool.h"
Public Member Functions | |
void | QMPool_init (QMPool *const me, void *const poolSto, uint_fast32_t const poolSize, uint_fast16_t const blockSize) |
void * | QMPool_get (QMPool *const me, uint_fast16_t const margin, uint_fast8_t const qsId) |
void | QMPool_put (QMPool *const me, void *const block, uint_fast8_t const qsId) |
Private Attributes | |
void ** | start |
Start of the memory managed by this memory pool. | |
void ** | end |
End of the memory managed by this memory pool. | |
void **volatile | freeHead |
QMPoolSize | blockSize |
Memory block size [bytes] held by this fixed-size pool. | |
QMPoolCtr | nTot |
Total number of memory blocks in this pool. | |
QMPoolCtr volatile | nFree |
Number of free memory blocks remaining in the pool at this point. | |
QMPoolCtr | nMin |
Minimum number of free blocks ever present in this pool. | |
Native QF Memory Pool.
A fixed block-size memory pool is a very fast and efficient data structure for dynamic allocation of fixed block-size chunks of memory. A memory pool offers fast and deterministic allocation and recycling of memory blocks and is not subject to fragmentation.
The QMPool class describes the native QF memory pool, which can be used as the event pool for mutable event allocation, or as a fast, deterministic fixed block-size heap for any other objects in your application.
void QMPool_init | ( | QMPool *const | me, |
void *const | poolSto, | ||
uint_fast32_t const | poolSize, | ||
uint_fast16_t const | blockSize ) |
void * QMPool_get | ( | QMPool *const | me, |
uint_fast16_t const | margin, | ||
uint_fast8_t const | qsId ) |
void QMPool_put | ( | QMPool *const | me, |
void *const | block, | ||
uint_fast8_t const | qsId ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |