QP/C  8.0.0
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qmpool.h File Reference

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

Go to the source code of this file.

Classes

struct  QFreeBlock
 Structure representing a free block in QMPool. More...
 
class  QMPool
 Native QF Memory Pool. More...
 

Macros

#define QF_MPOOL_EL(evType_)
 Memory pool element to allocate correctly aligned storage for QMPool class.
 

Typedefs

typedef uint16_t QMPoolSize
 The data type to store the block-size based on the macro QF_MPOOL_SIZ_SIZE.
 
typedef uint16_t QMPoolCtr
 The data type to store the block-counter based on the macro QF_MPOOL_CTR_SIZE.
 

Detailed Description

QP native platform-independent memory pool QMPool interface.

Backward Traceability
  • DVP_QP_MC4_D04_08 : Directive 4.8(Advisory): If a pointer to a structure or union is never dereferenced within a translation unit then the implementation of the object should be hidden

Definition in file qmpool.h.

Macro Definition Documentation

◆ QF_MPOOL_EL

#define QF_MPOOL_EL ( evType_)
Value:
struct { \
QFreeBlock sto_[((sizeof(evType_) - 1U) / (2U * sizeof(void *))) + 1U]; \
}
Structure representing a free block in QMPool.
Definition qmpool.h:73

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

Parameters
[in]evType_event type (name of the subclass of QEvt)
Backward Traceability
  • DVP_QP_MC4_D04_09A : Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)
Usage
static QF_MPOOL_EL(QEvt) smallPoolSto[CONFIG_QPC_SMALL_POOL_SIZE];
typedef struct {
QEvt super;
uint32_t data[CONFIG_QPC_MEDIUM_POOL_ENTRY_SIZE];
} mediumPool;
static QF_MPOOL_EL(mediumPool) mediumPoolSto[CONFIG_QPC_MEDIUM_POOL_SIZE];
typedef struct {
QEvt super;
uint32_t data[CONFIG_QPC_LARGE_POOL_ENTRY_SIZE];
} largePool;
static QF_MPOOL_EL(largePool) largePoolSto[CONFIG_QPC_LARGE_POOL_SIZE];
. . .
int_t main() {
. . .
// initialize Event Memory Pools...
QF_poolInit(smallPoolSto, sizeof(smallPoolSto), sizeof(smallPoolSto[0]));
QF_poolInit(mediumPoolSto, sizeof(mediumPoolSto), sizeof(mediumPoolSto[0]));
QF_poolInit(largePoolSto, sizeof(largePoolSto), sizeof(largePoolSto[0]));
. . .
}
#define QF_MPOOL_EL(evType_)
Memory pool element to allocate correctly aligned storage for QMPool class.
Definition qmpool.h:65
Event class.
Definition qp.h:131

Definition at line 65 of file qmpool.h.

Typedef Documentation

◆ QMPoolSize

typedef uint16_t QMPoolSize

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

Details
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 48 of file qmpool.h.

◆ QMPoolCtr

typedef uint16_t QMPoolCtr

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

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

Definition at line 58 of file qmpool.h.