Embedded Artistry Framework
Embedded Systems C++ Framework
Macros | Functions | Variables
heap.cpp File Reference
#include "heap.hpp"
#include <FreeRTOS.h>
#include <cstdint>
#include <cstdlib>
#include <task.h>
Include dependency graph for heap.cpp:

Macros

#define FREERTOS_HEAP_REGION_CNT   2
 NOTE: This FreeRTOS malloc implementation requires heap_5.c. More...
 

Functions

static int cmp_heap (const void *a, const void *b) noexcept
 

Variables

static const uint8_t heap_region_max = FREERTOS_HEAP_REGION_CNT
 Maximum number of heap regions that can be specified. More...
 
static volatile uint8_t heap_region_cnt = 0
 Current number of allocated heap regions. More...
 
static HeapRegion_t heap_regions [FREERTOS_HEAP_REGION_CNT+1]
 FreeRTOS internal memory pool stucture when using heap_5.c. More...
 

Macro Definition Documentation

◆ FREERTOS_HEAP_REGION_CNT

#define FREERTOS_HEAP_REGION_CNT   2

NOTE: This FreeRTOS malloc implementation requires heap_5.c.

Please define the correct heap_region for your project.Your application can define this macro to increase the number of heap regions

Function Documentation

◆ cmp_heap()

static int cmp_heap ( const void *  a,
const void *  b 
)
staticnoexcept

References a, and b.

Referenced by os::freertos::Heap::init().

Variable Documentation

◆ heap_region_cnt

volatile uint8_t heap_region_cnt = 0
static

Current number of allocated heap regions.

Referenced by os::freertos::Heap::addBlock(), and os::freertos::Heap::init().

◆ heap_region_max

const uint8_t heap_region_max = FREERTOS_HEAP_REGION_CNT
static

Maximum number of heap regions that can be specified.

Referenced by os::freertos::Heap::addBlock().

◆ heap_regions

HeapRegion_t heap_regions[FREERTOS_HEAP_REGION_CNT+1]
static

FreeRTOS internal memory pool stucture when using heap_5.c.

The block with the lowest starting address should appear first in the array

An additional block is allocated to serve as a NULL terminator

Referenced by os::freertos::Heap::addBlock(), and os::freertos::Heap::init().