CMSIS-DSP  
CMSIS DSP Software Library
 
Loading...
Searching...
No Matches
Miscellaneous utilities for memory

Data Structures

struct  ListElem
 Simple list of elements. More...
 
class  MemoryPool< BUF_SIZE, UserAllocator >
 This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes. More...
 

Description

Miscellaneous utilities for implementing memory allocators


Data Structure Documentation

◆ arm_cmsis_dsp::ListElem

struct arm_cmsis_dsp::ListElem

Simple list of elements.

◆ arm_cmsis_dsp::MemoryPool

class arm_cmsis_dsp::MemoryPool
template<int BUF_SIZE, typename UserAllocator = default_user_allocator_malloc_free>
class arm_cmsis_dsp::MemoryPool< BUF_SIZE, UserAllocator >

This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes.

Template Parameters
BUF_SIZESize of a buffer known at build time
UserAllocatorMemory allocator to allocate the memory buffer

Public Member Functions

 MemoryPool (const uint16_t nbBufs)
 Create a new memory pool.
 
 ~MemoryPool ()
 Destroys the object.
 
char * get_new_buffer () noexcept
 Gets the new free buffer.
 
void recycle_buffer (char *buf) noexcept
 Release the buffer so that it can be reused.
 
void reset () noexcept
 Release all the buffers so that they can be reused.
 

Constructor & Destructor Documentation

◆ MemoryPool()

MemoryPool ( const uint16_t  nbBufs)
inlineexplicit

Create a new memory pool.

Parameters
[in]nbBufsThe number of buffers to pre-allocate

Member Function Documentation

◆ get_new_buffer()

char * get_new_buffer ( )
inlinenoexcept

Gets the new free buffer.

Returns
The new buffer.

◆ recycle_buffer()

void recycle_buffer ( char *  buf)
inlinenoexcept

Release the buffer so that it can be reused.

Parameters
bufThe buffer