54Q_DEFINE_THIS_MODULE(
"qf_mem")
58#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
59#error qpc version 7.3.0 or higher required
69void QMPool_init(
QMPool *
const me,
71 uint_fast32_t
const poolSize,
72 uint_fast16_t
const blockSize)
79 && (poolSize >= (uint_fast32_t)
sizeof(
QFreeBlock))
80 && ((uint_fast16_t)(blockSize +
sizeof(
QFreeBlock)) > blockSize));
86 uint_fast16_t nblocks = 1U;
100 for (uint_fast32_t size = poolSize - me->
blockSize;
104 fb->next = &fb[nblocks];
129 uint_fast16_t
const margin,
130 uint_fast8_t
const qsId)
155 if (me->
nFree == 0U) {
170 (me->
start <= fb_next) && (fb_next <= me->end));
183 QS_MPC_PRE_(me->
nFree);
184 QS_MPC_PRE_(me->
nMin);
193 QS_MPC_PRE_(me->
nFree);
208 uint_fast8_t
const qsId)
221 && (me->
start <= fb) && (fb <= me->end));
236 QS_MPC_PRE_(me->
nFree);
#define Q_UNUSED_PAR(par_)
Internal (package scope) QP/C interface.
#define Q_UINTPTR_CAST_(ptr_)
@ QS_QF_MPOOL_GET_ATTEMPT
attempt to get a memory block failed
@ QS_QF_MPOOL_PUT
a memory block was returned to memory pool
@ QS_QF_MPOOL_GET
a memory block was removed from memory pool
QS/C package-scope interface.
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
#define Q_REQUIRE_INCRIT(id_, expr_)
Structure representing a free block in QMPool.
QFreeBlock *volatile free_head