Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.

Dependents:   denki-yohou_b TestY201 Network-RTOS NTPClient_HelloWorld ... more

Embed: (wiki syntax)

« Back to documentation index

MemoryPool< T, pool_sz > Class Template Reference

MemoryPool< T, pool_sz > Class Template Reference
[Rtos]

Define and manage fixed-size memory pools of objects of a given type. More...

#include <MemoryPool.h>

Public Member Functions

 MemoryPool ()
 Create and Initialize a memory pool.
T * alloc (void)
 Allocate a memory block of type T from a memory pool.
T * calloc (void)
 Allocate a memory block of type T from a memory pool and set memory block to zero.
osStatus free (T *block)
 Return an allocated memory block back to a specific memory pool.

Detailed Description

template<typename T, uint32_t pool_sz>
class rtos::MemoryPool< T, pool_sz >

Define and manage fixed-size memory pools of objects of a given type.

Template Parameters:
Tdata type of a single object (element).
queue_szmaximum number of objects (elements) in the memory pool.

Definition at line 39 of file MemoryPool.h.


Constructor & Destructor Documentation

MemoryPool (  )

Create and Initialize a memory pool.

Definition at line 42 of file MemoryPool.h.