dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Heap Allocation Abstraction

Heap allocation abstraction to hide details of allocation from SRAM and CCM RAM. More...

Data Structures

struct  pios_heap
 

Macros

#define DEBUG_MALLOC_FAILURES   0
 
#define DEBUG_MALLOC_FAILURES   0
 

Functions

static void malloc_failed_hook (void)
 
bool PIOS_heap_malloc_failed_p (void)
 
static bool is_ptr_in_heap_p (const struct pios_heap *heap, void *buf)
 
static void * simple_malloc (struct pios_heap *heap, size_t size)
 
static void simple_free (struct pios_heap *heap, void *buf)
 
static size_t simple_get_free_bytes (struct pios_heap *heap)
 
static void simple_extend_heap (struct pios_heap *heap, size_t bytes)
 
void * pvPortMalloc (size_t size) __attribute__((alias("PIOS_malloc")
 
void * PIOS_malloc (size_t size)
 
void * PIOS_malloc_no_dma (size_t size)
 
void vPortFree (void *buf) __attribute__((alias("PIOS_free")))
 
void PIOS_free (void *buf)
 
size_t xPortGetFreeHeapSize (void)
 
size_t PIOS_fastheap_get_free_size (void)
 
void PIOS_heap_initialize_blocks (void)
 
void PIOS_heap_increase_size (size_t bytes)
 
void * _sbrk (int incr)
 
size_t PIOS_heap_get_free_size (void)
 

Variables

static volatile bool malloc_failed_flag = false
 
struct pios_heap __attribute__
 
const void * _eheap
 
const void * _sheap
 
static struct pios_heap pios_standard_heap
 
void weak
 
static uintptr_t sbrk_pool [1024]
 
static uintptr_t brk_ptr = (uintptr_t) sbrk_pool
 
static volatile bool malloc_failed_flag = false
 

Detailed Description

Heap allocation abstraction to hide details of allocation from SRAM and CCM RAM.

Macro Definition Documentation

#define DEBUG_MALLOC_FAILURES   0

Definition at line 33 of file pios_heap.c.

#define DEBUG_MALLOC_FAILURES   0

Definition at line 35 of file pios_heap.c.

Function Documentation

void* _sbrk ( int  incr)

Definition at line 253 of file pios_heap.c.

static bool is_ptr_in_heap_p ( const struct pios_heap heap,
void *  buf 
)
static

Definition at line 62 of file pios_heap.c.

static void malloc_failed_hook ( void  )
static

Definition at line 37 of file pios_heap.c.

size_t PIOS_fastheap_get_free_size ( void  )

Definition at line 221 of file pios_heap.c.

void PIOS_free ( void *  buf)

Definition at line 174 of file pios_heap.c.

size_t PIOS_heap_get_free_size ( void  )

Definition at line 74 of file pios_heap.c.

void PIOS_heap_increase_size ( size_t  bytes)

Definition at line 233 of file pios_heap.c.

void PIOS_heap_initialize_blocks ( void  )

Definition at line 228 of file pios_heap.c.

bool PIOS_heap_malloc_failed_p ( void  )

Definition at line 47 of file pios_heap.c.

void * PIOS_malloc ( size_t  size)

Definition at line 125 of file pios_heap.c.

void * PIOS_malloc_no_dma ( size_t  size)

Definition at line 166 of file pios_heap.c.

void* pvPortMalloc ( size_t  size)
static void simple_extend_heap ( struct pios_heap heap,
size_t  bytes 
)
static

Definition at line 106 of file pios_heap.c.

static void simple_free ( struct pios_heap heap,
void *  buf 
)
static

Definition at line 93 of file pios_heap.c.

static size_t simple_get_free_bytes ( struct pios_heap heap)
static

Definition at line 98 of file pios_heap.c.

static void* simple_malloc ( struct pios_heap heap,
size_t  size 
)
static

Definition at line 69 of file pios_heap.c.

void vPortFree ( void *  buf)
size_t xPortGetFreeHeapSize ( void  )

Definition at line 185 of file pios_heap.c.

Variable Documentation

const void* _eheap
const void* _sheap
uintptr_t brk_ptr = (uintptr_t) sbrk_pool
static

Definition at line 251 of file pios_heap.c.

volatile bool malloc_failed_flag = false
static

Definition at line 34 of file pios_heap.c.

volatile bool malloc_failed_flag = false
static

Definition at line 36 of file pios_heap.c.

struct pios_heap pios_standard_heap
static
Initial value:
= {
.start_addr = (const uintptr_t)&_sheap,
.end_addr = (const uintptr_t)&_eheap,
.free_addr = (uintptr_t)&_sheap,
}
const void * _eheap
const void * _sheap

Definition at line 117 of file pios_heap.c.

uintptr_t sbrk_pool[1024]
static

Definition at line 250 of file pios_heap.c.

void weak

Definition at line 124 of file pios_heap.c.