Embedded Wireless Framework
Data Structures | Macros | Typedefs | Functions
The ThreadX allocator

The ThreadX allocator. More...

Data Structures

struct  _ewf_allocator_threadx
 ThreadX allocator implementation type. More...
 

Macros

#define EWF_ALLOCATOR_THREADX_INITIALIZE_HEADER(allocator_ptr)
 
#define EWF_ALLOCATOR_THREADX_STATIC_DECLARE(allocator_ptr, allocator_name_symb, block_count_param, block_size_param)
 Declare a ThreadX allocator. More...
 

Typedefs

typedef struct _ewf_allocator_threadx ewf_allocator_threadx
 ThreadX allocator implementation type.
 

Functions

ewf_result ewf_allocator_threadx_start (ewf_allocator *allocator_ptr)
 
ewf_result ewf_allocator_threadx_stop (ewf_allocator *allocator_ptr)
 
ewf_result ewf_allocator_threadx_allocate (ewf_allocator *allocator_ptr, void **p)
 
ewf_result ewf_allocator_threadx_release (ewf_allocator *allocator_ptr, void *p)
 

Detailed Description

The ThreadX allocator.

Macro Definition Documentation

◆ EWF_ALLOCATOR_THREADX_STATIC_DECLARE

#define EWF_ALLOCATOR_THREADX_STATIC_DECLARE (   allocator_ptr,
  allocator_name_symb,
  block_count_param,
  block_size_param 
)
Value:
do { \
static ULONG block_pool_buffer__##allocator_name_symb[(block_count_param * (block_size_param + sizeof(void*))) / sizeof(ULONG)]; \
static ewf_allocator_threadx ewf_allocator_threadx__##allocator_name_symb = {0}; \
static ewf_allocator ewf_allocator__##allocator_name_symb = {0}; \
ewf_allocator_threadx__##allocator_name_symb.block_pool_buffer_ptr = block_pool_buffer__##allocator_name_symb; \
ewf_allocator_threadx__##allocator_name_symb.pool_size = sizeof(block_pool_buffer__##allocator_name_symb); \
ewf_allocator__##allocator_name_symb.block_count = (ULONG) block_count_param; \
ewf_allocator__##allocator_name_symb.block_size = (ULONG) block_size_param; \
ewf_allocator__##allocator_name_symb.start = ewf_allocator_threadx_start; \
ewf_allocator__##allocator_name_symb.stop = ewf_allocator_threadx_stop; \
ewf_allocator__##allocator_name_symb.allocate = ewf_allocator_threadx_allocate; \
ewf_allocator__##allocator_name_symb.release = ewf_allocator_threadx_release; \
ewf_allocator__##allocator_name_symb.implementation_ptr = &(ewf_allocator_threadx__##allocator_name_symb); \
allocator_ptr = &(ewf_allocator__##allocator_name_symb); \
EWF_ALLOCATOR_THREADX_INITIALIZE_HEADER(allocator_ptr); \
} while(0)
ThreadX allocator implementation type.
Definition: ewf_allocator_threadx.h:32
The allocator structure definition.
Definition: ewf_allocator.h:27

Declare a ThreadX allocator.

Parameters
[in,out]allocator_ptra pointer to an allocator that will be initialized to point to the one statically declared by the macro
[in]allocator_name_symba unique symbol name that will be used as a name suffix for the statically declared data
[in]block_countthe number of blocks
[in]block_sizethe size of each block