Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
tlsf_malloc_arch.c File Reference

Dynamic memory allocation based on TLSF library. More...

#include <ch.h>
#include <tlsf.h>
#include "modules/tlsf/tlsf_malloc.h"
Include dependency graph for tlsf_malloc_arch.c:

Go to the source code of this file.

Data Structures

struct  _tlsf_memory_heap_t

Macros

#define HEAP_CCM_BUFFER   HEAP_CCM ## _buffer
#define HEAP_CCM_MTX   HEAP_CCM ## _mtx
#define error_cb   NULL

Functions

static MUTEX_DECL (HEAP_CCM_MTX)
static void stat_tlsf_walker (void *ptr, size_t size, int used, void *user)
void tlsf_init_heaps (void)
void * tlsf_get_heap_addr (const tlsf_memory_heap_t *heap)
void * tlsf_malloc_r (tlsf_memory_heap_t *heap, size_t bytes)
void * tlsf_memalign_r (tlsf_memory_heap_t *heap, size_t align, size_t bytes)
void * tlsf_realloc_r (tlsf_memory_heap_t *heap, void *ptr, size_t bytes)
void tlsf_free_r (tlsf_memory_heap_t *heap, void *ptr)
void tlsf_stat_r (tlsf_memory_heap_t *heap, struct tlsf_stat_t *stat)
int tlsf_check_r (tlsf_memory_heap_t *heap)

Variables

static uint8_t HEAP_CCM_BUFFER [HEAP_CCM_SIZE]
tlsf_memory_heap_t HEAP_CCM

Detailed Description

Dynamic memory allocation based on TLSF library.

Definition in file tlsf_malloc_arch.c.


Data Structure Documentation

◆ _tlsf_memory_heap_t

struct _tlsf_memory_heap_t

Definition at line 33 of file tlsf_malloc_arch.c.

Data Fields
mutex_t * mtx
tlsf_t tlsf

Macro Definition Documentation

◆ error_cb

#define error_cb   NULL

Definition at line 71 of file tlsf_malloc_arch.c.

Referenced by adc_configure(), and tlsf_init_heaps().

◆ HEAP_CCM_BUFFER

#define HEAP_CCM_BUFFER   HEAP_CCM ## _buffer

Definition at line 40 of file tlsf_malloc_arch.c.

Referenced by tlsf_init_heaps().

◆ HEAP_CCM_MTX

#define HEAP_CCM_MTX   HEAP_CCM ## _mtx

Definition at line 41 of file tlsf_malloc_arch.c.

Referenced by MUTEX_DECL(), and tlsf_init_heaps().

Function Documentation

◆ MUTEX_DECL()

MUTEX_DECL ( HEAP_CCM_MTX )
static

References HEAP_CCM_MTX.

◆ stat_tlsf_walker()

void stat_tlsf_walker ( void * ptr,
size_t size,
int used,
void * user )
static

Definition at line 151 of file tlsf_malloc_arch.c.

References tlsf_stat_t::mfree, and tlsf_stat_t::mused.

Referenced by tlsf_stat_r().

Here is the caller graph for this function:

◆ tlsf_check_r()

int tlsf_check_r ( tlsf_memory_heap_t * heap)

Definition at line 137 of file tlsf_malloc_arch.c.

References _tlsf_memory_heap_t::mtx, and _tlsf_memory_heap_t::tlsf.

◆ tlsf_free_r()

void tlsf_free_r ( tlsf_memory_heap_t * heap,
void * ptr )

Definition at line 119 of file tlsf_malloc_arch.c.

References _tlsf_memory_heap_t::mtx, and _tlsf_memory_heap_t::tlsf.

Referenced by msgqueue_send_timeout().

Here is the caller graph for this function:

◆ tlsf_get_heap_addr()

void * tlsf_get_heap_addr ( const tlsf_memory_heap_t * heap)

Definition at line 90 of file tlsf_malloc_arch.c.

References _tlsf_memory_heap_t::tlsf.

Referenced by msgqueue_pop_timeout(), and msgqueue_send_timeout().

Here is the caller graph for this function:

◆ tlsf_init_heaps()

void tlsf_init_heaps ( void )

◆ tlsf_malloc_r()

void * tlsf_malloc_r ( tlsf_memory_heap_t * heap,
size_t bytes )

Definition at line 95 of file tlsf_malloc_arch.c.

References _tlsf_memory_heap_t::mtx, and _tlsf_memory_heap_t::tlsf.

Referenced by msgqueue_copy_send_timeout().

Here is the caller graph for this function:

◆ tlsf_memalign_r()

void * tlsf_memalign_r ( tlsf_memory_heap_t * heap,
size_t align,
size_t bytes )

Definition at line 103 of file tlsf_malloc_arch.c.

References _tlsf_memory_heap_t::mtx, and _tlsf_memory_heap_t::tlsf.

◆ tlsf_realloc_r()

void * tlsf_realloc_r ( tlsf_memory_heap_t * heap,
void * ptr,
size_t bytes )

Definition at line 111 of file tlsf_malloc_arch.c.

References _tlsf_memory_heap_t::mtx, and _tlsf_memory_heap_t::tlsf.

◆ tlsf_stat_r()

void tlsf_stat_r ( tlsf_memory_heap_t * heap,
struct tlsf_stat_t * stat )

Definition at line 127 of file tlsf_malloc_arch.c.

References tlsf_stat_t::mfree, _tlsf_memory_heap_t::mtx, tlsf_stat_t::mused, stat_tlsf_walker(), and _tlsf_memory_heap_t::tlsf.

Here is the call graph for this function:

Variable Documentation

◆ HEAP_CCM

Definition at line 44 of file tlsf_malloc_arch.c.

◆ HEAP_CCM_BUFFER

uint8_t HEAP_CCM_BUFFER[HEAP_CCM_SIZE]
static

Definition at line 42 of file tlsf_malloc_arch.c.