QP/C++ 8.1.2
Real-Time Event Framework
Loading...
Searching...
No Matches
qmpool.hpp File Reference

QP/C++ native platform-independent memory pool QP::QMPool interface. More...

Go to the source code of this file.

Classes

class  QP::QMPool
 Native QF Memory Pool. More...

Namespaces

namespace  QP
 QP/C++ Framework namespace.

Macros

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

Typedefs

using QP::QMPoolSize = std::uint16_t
 The data type to store the block-size based on the macro QF_MPOOL_SIZ_SIZE.
using QP::QMPoolCtr = std::uint16_t
 The data type to store the block-counter based on the macro QF_MPOOL_CTR_SIZE.

Detailed Description

QP/C++ native platform-independent memory pool QP::QMPool interface.

Forward Traceability

Definition in file qmpool.hpp.

Macro Definition Documentation

◆ QF_MPOOL_EL

#define QF_MPOOL_EL ( evType_)
Value:
struct { \
void * sto_[((sizeof(evType_) - 1U) / sizeof(void *)) + \
(sizeof(evType_) < (2U * sizeof(void *)) ? 2U : 1U)]; }

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

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

Usage

static QF_MPOOL_EL(QP::QEvt) smallPoolSto[CONFIG_QPC_SMALL_POOL_SIZE];
struct {
QP::QEvt evt;
std::uint8_t data[CONFIG_QPC_MEDIUM_POOL_ENTRY_SIZE];
} mediumPool;
static QF_MPOOL_EL(mediumPool) mediumPoolSto[CONFIG_QPC_MEDIUM_POOL_SIZE];
struct {
QP::QEvt evt;
uint32_t data[CONFIG_QPC_LARGE_POOL_ENTRY_SIZE];
} largePool;
static QF_MPOOL_EL(largePool) largePoolSto[CONFIG_QPC_LARGE_POOL_SIZE];
. . .
int 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]));
. . .
}
Event class.
Definition qp.hpp:101
#define QF_MPOOL_EL(evType_)
Memory pool element to allocate correctly aligned storage for QMPool class.
Definition qmpool.hpp:39

Forward Traceability

  • DVR_QP_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 39 of file qmpool.hpp.