CMSIS-RTOS RTX
Version 4.80
CMSIS-RTOS RTX: Real-Time Operating System for Cortex-M processor-based devices
|
Define and manage fixed-size memory pools. More...
Macros | |
#define | osFeature_Pool 1 |
Memory Pools available. | |
#define | osPoolDef(name, no, type) |
Define a Memory Pool. | |
#define | osPool(name) &os_pool_def_##name |
Access a Memory Pool definition. | |
Functions | |
osPoolId | osPoolCreate (const osPoolDef_t *pool_def) |
Create and Initialize a memory pool. | |
void * | osPoolAlloc (osPoolId pool_id) |
Allocate a memory block from a memory pool. | |
void * | osPoolCAlloc (osPoolId pool_id) |
Allocate a memory block from a memory pool and set memory block to zero. | |
osStatus | osPoolFree (osPoolId pool_id, void *block) |
Return an allocated memory block back to a specific memory pool. | |
The Memory Pool Management function group is used to define and manage fixed-sized memory pools.
#define osFeature_Pool 1 |
CMSIS-RTOS RTX supports fixed-size memory pools.
#define osPool | ( | name | ) | &os_pool_def_##name |
Access a memory pool for the functions osPoolCreate.
name | name of the memory pool |
#define osPoolDef | ( | name, | |
no, | |||
type | |||
) |
Define a memory pool that is referenced by osPool.
name | name of the memory pool. |
no | maximum number of blocks (objects) in the memory pool. |
type | data type of a single block (object). |
void * osPoolAlloc | ( | osPoolId | pool_id | ) |
[in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
Allocate a memory block from the memory pool.
Example
void * osPoolCAlloc | ( | osPoolId | pool_id | ) |
[in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
Allocate a memory block from the memory pool. The block is initialized to zero.
Example
osPoolId osPoolCreate | ( | const osPoolDef_t * | pool_def | ) |
[in] | pool_def | memory pool definition referenced with osPool. |
Create and initialize a memory pool.
Example
[in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
[in] | block | address of the allocated memory block that is returned to the memory pool. |
Return a memory block to a memory pool.
Example