QP/C  7.0.0
Real-Time Embedded Framework
qmpool.h File Reference

QP native, platform-independent memory pool QMPool interface. More...

Go to the source code of this file.

Data Structures

struct  QMPool
 

Macros

#define QF_MPOOL_EL(evType_)    struct { void *sto_[((sizeof(evType_) - 1U)/sizeof(void*)) + 1U]; }
 

Typedefs

typedef uint8_t QMPoolSize
 
typedef uint8_t QMPoolCtr
 

Functions

void QMPool_init (QMPool *const me, void *const poolSto, uint_fast32_t poolSize, uint_fast16_t blockSize)
 
void * QMPool_get (QMPool *const me, uint_fast16_t const margin, uint_fast8_t const qs_id)
 
void QMPool_put (QMPool *const me, void *b, uint_fast8_t const qs_id)
 

Detailed Description

Date
Last updated on: 2021-12-23
Version
Last updated for: Version 7.0.0, 2022-04-30

Definition in file qmpool.h.

Macro Definition Documentation

◆ QF_MPOOL_EL

#define QF_MPOOL_EL (   evType_)     struct { void *sto_[((sizeof(evType_) - 1U)/sizeof(void*)) + 1U]; }

Memory pool element to allocate correctly aligned storage for QMPool class.

Parameters
[in]evType_event type (name of the subclass of QEvt)

Definition at line 151 of file qmpool.h.

Typedef Documentation

◆ QMPoolSize

typedef uint8_t QMPoolSize

The data type to store the block-size based on the macro #QF_MPOOL_SIZ_SIZE.

The dynamic range of this data type determines the maximum size of blocks that can be managed by the native QF event pool.

Definition at line 50 of file qmpool.h.

◆ QMPoolCtr

typedef uint8_t QMPoolCtr

The data type to store the block-counter based on the macro #QF_MPOOL_CTR_SIZE.

The dynamic range of this data type determines the maximum number of blocks that can be stored in the pool.

Definition at line 75 of file qmpool.h.

Function Documentation

◆ QMPool_init()

void QMPool_init ( QMPool *const  me,
void *const  poolSto,
uint_fast32_t  poolSize,
uint_fast16_t  blockSize 
)

Initializes the native QF memory pool

◆ QMPool_get()

void * QMPool_get ( QMPool *const  me,
uint_fast16_t const  margin,
uint_fast8_t const  qs_id 
)

Obtains a memory block from a memory pool.

◆ QMPool_put()

void QMPool_put ( QMPool *const  me,
void *  b,
uint_fast8_t const  qs_id 
)

Recycles a memory block back to a memory pool.