|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
#include <stdlib.h>

Functions | |
| void | malloc_addblock (void *addr, size_t size) |
| Assign blocks of memory for use by malloc(). More... | |
| void | malloc_init (void) |
| Initialize Malloc. More... | |
| void malloc_addblock | ( | void * | addr, |
| size_t | size | ||
| ) |
Assign blocks of memory for use by malloc().
Initializes the malloc() backend with a memory address and memory pool size. This memory is assumed to be owned by malloc() and is vended out when memory is requested. Multiple blocks can be added.
NOTE: This API must be called before malloc() can be used. If you call malloc() before allocating memory, malloc() will return NULL because there is no available memory to provide to the user.
| addr | Pointer to the memory block address that you are providing to malloc() |
| size | Size of the memory block that you are providing to malloc() |
Assign blocks of memory for use by malloc().
In this FreeRTOS implementation, malloc() calls will block until memory has been allocated
Assign blocks of memory for use by malloc().
In this ThreadX implementation, malloc() calls will block until memory has been allocated
References embvm::VirtualHeap< THeapImpl >::addBlock(), align_up, ALLOC_HEADER_SZ, assert, heap_region_cnt, heap_region_max, heap_regions, initialized_, list_add(), malloc_pool_, alloc_node_t::node, r, alloc_node_t::size, tx_byte_pool_create, and TX_SUCCESS.
Referenced by allocate_memory(), NRF52DongleHWPlatform::earlyInitHook_(), and nRF52DK_FrameworkDemoPlatform::earlyInitHook_().

| void malloc_init | ( | void | ) |
Initialize Malloc.
Weakly linked, can be overridden based on your needs. Each malloc implementation contains a different set of initialization requirements
1.8.15