33#ifndef QF_MPOOL_SIZ_SIZE
34 #define QF_MPOOL_SIZ_SIZE 2U
36#ifndef QF_MPOOL_CTR_SIZE
37 #define QF_MPOOL_CTR_SIZE 2U
40#define QF_MPOOL_EL(evType_) struct { \
41 void * sto_[((sizeof(evType_) - 1U) / sizeof(void *)) + \
42 (sizeof(evType_) < (2U * sizeof(void *)) ? 2U : 1U)]; \
45#if (QF_MPOOL_SIZ_SIZE == 1U)
47#elif (QF_MPOOL_SIZ_SIZE == 2U)
49#elif (QF_MPOOL_SIZ_SIZE == 4U)
52 #error QF_MPOOL_SIZ_SIZE defined incorrectly, expected 1U, 2U, or 4U
55#if (QF_MPOOL_CTR_SIZE == 1U)
57#elif (QF_MPOOL_CTR_SIZE == 2U)
59#elif (QF_MPOOL_CTR_SIZE == 4U)
62 #error QF_MPOOL_CTR_SIZE defined incorrectly, expected 1U, 2U, or 4U
80 uint_fast32_t
const poolSize,
85 uint_fast16_t
const margin,
86 uint_fast8_t
const qsId);
91 uint_fast8_t
const qsId);
uint16_t QMPoolSize
The data type to store the block-size based on the macro QF_MPOOL_SIZ_SIZE.
uint16_t QMPoolCtr
The data type to store the block-counter based on the macro QF_MPOOL_CTR_SIZE.
void ** end
End of the memory managed by this memory pool.
void QMPool_put(QMPool *const me, void *const block, uint_fast8_t const qsId)
void * QMPool_get(QMPool *const me, uint_fast16_t const margin, uint_fast8_t const qsId)
void ** start
Start of the memory managed by this memory pool.
QMPoolCtr volatile nFree
Number of free memory blocks remaining in the pool at this point.
void QMPool_init(QMPool *const me, void *const poolSto, uint_fast32_t const poolSize, uint_fast16_t const blockSize)
QMPoolSize blockSize
Memory block size [bytes] held by this fixed-size pool.
QMPoolCtr nMin
Minimum number of free blocks ever present in this pool.
QMPoolCtr nTot
Total number of memory blocks in this pool.