Embedded Wireless Framework
Modules | Data Structures | Macros | Functions
EWF Allocator API

Allocators are used to allocate and free buffers for interfaces and adapters. More...

Modules

 The C heap allocator
 The C heap allocator.
 
 The ThreadX allocator
 The ThreadX allocator.
 

Data Structures

struct  _ewf_allocator
 The allocator structure definition. More...
 

Macros

#define EWF_ALLOCATOR_STRUCT_MAGIC   (0xA110CA70) /* ~~ allocato(r) */
 
#define EWF_ALLOCATOR_STRUCT_SIZE   (sizeof(struct _ewf_allocator))
 
#define EWF_ALLOCATOR_VERSION   (EWF_DEVELOPER_MICROSOFT | 0x0001)
 
#define EWF_ALLOCATOR_VALIDATE_POINTER(allocator_ptr)
 
#define EWF_ALLOCATOR_VALIDATE_POINTER_TYPE(allocator_ptr, allocator_type)
 

Functions

ewf_result ewf_allocator_start (ewf_allocator *allocator_ptr)
 Start the allocator. More...
 
ewf_result ewf_allocator_stop (ewf_allocator *allocator_ptr)
 Stop the allocator. More...
 
ewf_result ewf_allocator_allocate (ewf_allocator *allocator_ptr, void **p)
 Allocate a block from the allocator. More...
 
ewf_result ewf_allocator_release (ewf_allocator *allocator_ptr, void *p)
 Release a block back to the allocator. More...
 

Detailed Description

Allocators are used to allocate and free buffers for interfaces and adapters.

Macro Definition Documentation

◆ EWF_ALLOCATOR_VALIDATE_POINTER

#define EWF_ALLOCATOR_VALIDATE_POINTER (   allocator_ptr)
Value:
do { \
if ((allocator_ptr == NULL) || \
(allocator_ptr->implementation_ptr == NULL)) \
{ \
EWF_LOG_ERROR("The allocator pointer is invalid."); \
} \
} while(0)
@ EWF_RESULT_INVALID_FUNCTION_ARGUMENT
Definition: ewf.h:69

Function Documentation

◆ ewf_allocator_allocate()

ewf_result ewf_allocator_allocate ( ewf_allocator allocator_ptr,
void **  p 
)

Allocate a block from the allocator.

Parameters
[in]allocator_ptra pointer to an allocator control block
[in,out]paddress of a pointer to receive a pointer to the allocated block
Returns
ewf_result success and error conditions

◆ ewf_allocator_release()

ewf_result ewf_allocator_release ( ewf_allocator allocator_ptr,
void *  p 
)

Release a block back to the allocator.

Parameters
[in]allocator_ptra pointer to an allocator control block
p[in]a pointer to the block to be released
Returns
ewf_result success and error conditions

◆ ewf_allocator_start()

ewf_result ewf_allocator_start ( ewf_allocator allocator_ptr)

Start the allocator.

Parameters
[in]allocator_ptra pointer to an allocator control block
Returns
ewf_result success and error conditions

◆ ewf_allocator_stop()

ewf_result ewf_allocator_stop ( ewf_allocator allocator_ptr)

Stop the allocator.

Parameters
[in]allocator_ptra pointer to an allocator control block
Returns
ewf_result success and error conditions