46#ifndef QF_MPOOL_SIZ_SIZE
47 #define QF_MPOOL_SIZ_SIZE 2U
49#ifndef QF_MPOOL_CTR_SIZE
50 #define QF_MPOOL_CTR_SIZE 2U
53#if (QF_MPOOL_SIZ_SIZE == 1U)
55#elif (QF_MPOOL_SIZ_SIZE == 2U)
57#elif (QF_MPOOL_SIZ_SIZE == 4U)
60 #error "QF_MPOOL_SIZ_SIZE defined incorrectly, expected 1U, 2U, or 4U"
63#if (QF_MPOOL_CTR_SIZE == 1U)
65#elif (QF_MPOOL_CTR_SIZE == 2U)
67#elif (QF_MPOOL_CTR_SIZE == 4U)
70 #error "QF_MPOOL_CTR_SIZE defined incorrectly, expected 1U, 2U, or 4U"
73#define QF_MPOOL_EL(evType_) struct { \
74 QFreeBlock sto_[((sizeof(evType_) - 1U) \
75 / sizeof(QFreeBlock)) + 1U]; }
127 void *
const poolSto,
128 uint_fast32_t
const poolSize,
129 uint_fast16_t
const blockSize);
132void * QMPool_get(
QMPool *
const me,
133 uint_fast16_t
const margin,
134 uint_fast8_t
const qsId);
137void QMPool_put(
QMPool *
const me,
139 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.
Structure representing a free block in QMPool.
uintptr_t next_dis
Duplicate inverse storage for the next pointer (QP FuSa Subsystem)
struct QFreeBlock * next
Link to the next memory block.
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)
Initializes the native QF memory pool.
QMPoolSize blockSize
Memory block size [bytes] held by this fixed-size pool.
QFreeBlock * end
End of the memory managed by this memory pool.
QMPoolCtr nMin
Minimum number of free blocks ever present in this pool.
QFreeBlock *volatile free_head
Head of linked list of free memory blocks.
QFreeBlock * start
Start of the memory managed by this memory pool.
QMPoolCtr nTot
Total number of memory blocks in this pool.