QF_pool_[] definition and QF_poolInit() implementation. More...
#include "qf_pkg.h"#include "qassert.h"Go to the source code of this file.
Functions | |
| void | QF_poolInit (void *poolSto, uint32_t poolSize, QEventSize evtSize) |
| Event pool initialization for dynamic allocation of events. | |
Variables | |
| QF_EPOOL_TYPE_ | QF_pool_ [3] |
| uint8_t | QF_maxPool_ |
QF_pool_[] definition and QF_poolInit() implementation.
Definition in file qf_pool.c.
| void QF_poolInit | ( | void * | poolSto, | |
| uint32_t | poolSize, | |||
| QEventSize | evtSize | |||
| ) |
Event pool initialization for dynamic allocation of events.
This function initializes one event pool at a time and must be called exactly once for each event pool before the pool can be used. The arguments are as follows: poolSto is a pointer to the memory block for the events. poolSize is the size of the memory block in bytes. evtSize is the block-size of the pool in bytes, which determines the maximum size of events that can be allocated from the pool.
You might initialize one, two, and up to three event pools by making one, two, or three calls to the QF_poolInit() function. However, for the simplicity of the internal implementation, you must initialize event pools in the ascending order of the event size.
Many RTOSes provide fixed block-size heaps, a.k.a. memory pools that can be adapted for QF event pools. In case such support is missing, QF provides a native QF event pool implementation. The macro QF_EPOOL_TYPE_ determines the type of event pool used by a particular QF port. See structure QMPool for more information.
Definition at line 44 of file qf_pool.c.
References Q_DIM, Q_REQUIRE, QF_EPOOL_EVENT_SIZE_, and QF_EPOOL_INIT_.
# of initialized event pools
Definition at line 41 of file qf_pool.c.
Referenced by QF_gc(), QF_getPoolMargin(), and QF_new_().
1.6.3