RTOS lib used for Eurobot 2012
Dependents: Eurobot2012_Secondary Team_Sprint2 Team_Sprint2 Rafi_Final ... more
MemoryPool< T, pool_sz > Class Template Reference
#include <MemoryPool.h>
Public Member Functions | |
MemoryPool () | |
T * | alloc (void) |
T * | calloc (void) |
osStatus | free (T *block) |
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:
-
T data type of a single object (element). queue_sz maximum number of objects (elements) in the memory pool.
Definition at line 17 of file MemoryPool.h.
Constructor & Destructor Documentation
MemoryPool | ( | ) |
Create and Initialize a memory pool.
Definition at line 20 of file MemoryPool.h.
Member Function Documentation
T* alloc | ( | void | ) |
Allocate a memory block of type T from a memory pool.
- Returns:
- address of the allocated memory block or NULL in case of no memory available.
Definition at line 34 of file MemoryPool.h.
T* calloc | ( | void | ) |
Allocate a memory block of type T from a memory pool and set memory block to zero.
- Returns:
- address of the allocated memory block or NULL in case of no memory available.
Definition at line 41 of file MemoryPool.h.
osStatus free | ( | T * | block ) |
Return an allocated memory block back to a specific memory pool.
- Parameters:
-
address of the allocated memory block that is returned to the memory pool.
- Returns:
- status code that indicates the execution status of the function.
Definition at line 49 of file MemoryPool.h.
Generated on Wed Jul 13 2022 19:50:35 by 1.7.2