FreeRTOS C-Addons
1.1.0
C-Addon functionality to FreeRTOS
|
Go to the source code of this file.
Typedefs | |
typedef void * | MemoryPool_t |
Functions | |
MemoryPool_t | CreateMemoryPool (int itemSize, int itemCount, int Alignment) |
int | AddExtraMemoryToPool (MemoryPool_t pool, int ItemCount) |
MemoryPool_t | CreateMemoryPoolStatic (int ItemSize, void *PreallocatedMemory, int PreallocatedMemorySize, int Alignment) |
int | AddExtraMemoryToPoolStatic (MemoryPool_t pool, void *PreallocatedMemory, int PreallocatedMemorySize) |
void * | MemoryPoolAllocate (MemoryPool_t pool) |
void | MemoryPoolFree (MemoryPool_t pool, void *memory) |
typedef void* MemoryPool_t |
Handle for memory pools.
These are fixed allocation size memory areas.
Definition at line 49 of file mem_pool.h.
int AddExtraMemoryToPool | ( | MemoryPool_t | pool, |
int | ItemCount | ||
) |
There is no DeleteMemoryPool() by design! Allows you to add extra memory to a pool.
pool | An existing memory pool. |
ItemCount | How many more items you want to add. |
Definition at line 193 of file mem_pool.c.
int AddExtraMemoryToPoolStatic | ( | MemoryPool_t | pool, |
void * | PreallocatedMemory, | ||
int | PreallocatedMemorySize | ||
) |
Allows you to add extra memory to a pool.
pool | An existing memory pool. |
PreallocatedMemory | Pointer to the preallocated memory you are dedicating to this pool. |
PreallocatedMemorySize | How big is the buffer you are passing in. |
Definition at line 281 of file mem_pool.c.
MemoryPool_t CreateMemoryPool | ( | int | itemSize, |
int | itemCount, | ||
int | Alignment | ||
) |
Create a MemoryPool
itemSize | How big is an allocation. |
itemCount | What's the maximum number of allocations allowed? |
Alignment | Power of 2 value denoting on which address boundary the memory will be aligned to. Must be at least sizeof(unsigned char *). |
Definition at line 140 of file mem_pool.c.
MemoryPool_t CreateMemoryPoolStatic | ( | int | ItemSize, |
void * | PreallocatedMemory, | ||
int | PreallocatedMemorySize, | ||
int | Alignment | ||
) |
Create a MemoryPool
ItemSize | How big is an allocation. |
PreallocatedMemory | Pointer to the preallocated memory you are dedicating to this pool. |
PreallocatedMemorySize | How big is the buffer you are passing in. |
Alignment | Power of 2 value denoting on which address boundary the memory will be aligned to. Must be at least sizeof(unsigned char *). |
Definition at line 230 of file mem_pool.c.
void* MemoryPoolAllocate | ( | MemoryPool_t | pool | ) |
Get a memory buffer from the pool.
Note that this can block, and cannnot be used from ISR context.
pool | A handle to a MemoryPool. |
Definition at line 311 of file mem_pool.c.
void MemoryPoolFree | ( | MemoryPool_t | pool, |
void * | memory | ||
) |
Return a memory buffer to the pool.
pool | A handle to a MemoryPool. |
memory | memory obtained from MemoryPoolAllocate(). |
Definition at line 338 of file mem_pool.c.