VSF Documented
Data Structures | Macros | Typedefs | Functions
vsf_heap.h File Reference
#include "service/vsf_service_cfg.h"
#include "hal/arch/vsf_arch.h"
#include "utilities/vsf_utilities.h"
#include "service/trace/vsf_trace.h"
#include "utilities/ooc_class.h"

Go to the source code of this file.

Data Structures

struct  vsf_heap_statistics_t
 
class  vsf_heap_t
 

Macros

#define VSF_HEAP_ALIGN   (2 * sizeof(uintalu_t))
 
#define vsf_heap_malloc_aligned(...)
 
#define vsf_heap_malloc(...)
 
#define vsf_heap_realloc_aligned(...)
 
#define vsf_heap_realloc(...)
 
#define vsf_heap_free(__ptr)
 
#define VSF_HEAP_CFG_STATISTICS   ENABLED
 

Typedefs

typedef struct vsf_heap_statistics_t vsf_heap_statistics_t
 

Functions

void __vsf_heap_add_buffer (vsf_heap_t *heap, uint8_t *buffer, uint_fast32_t size)
 
void * __vsf_heap_malloc_aligned (vsf_heap_t *heap, uint_fast32_t size, uint_fast32_t alignment)
 
void * __vsf_heap_realloc_aligned (vsf_heap_t *heap, void *buffer, uint_fast32_t size, uint_fast32_t alignment)
 
void __vsf_heap_free (vsf_heap_t *heap, void *buffer)
 
uint_fast32_t __vsf_heap_size (vsf_heap_t *heap, void *buffer)
 
void __vsf_heap_statistics (vsf_heap_t *heap, vsf_heap_statistics_t *statistics)
 
void vsf_heap_statistics (vsf_heap_statistics_t *statistics)
 
uint_fast32_t vsf_heap_size (uint8_t *buffer)
 
void * vsf_heap_malloc_aligned_imp (uint_fast32_t size, uint_fast32_t alignment)
 
void * vsf_heap_malloc_imp (uint_fast32_t size)
 
void * vsf_heap_realloc_aligned_imp (void *buffer, uint_fast32_t size, uint_fast32_t alignment)
 
void * vsf_heap_realloc_imp (void *buffer, uint_fast32_t size)
 
void vsf_heap_free_imp (void *buffer)
 
void * vsf_heap_calloc (uint_fast32_t n, uint_fast32_t size)
 
char * vsf_heap_strdup (const char *str)
 

Variables

vsf heap interface
uint_fast32_t alignment
 
void *(* Malloc )(uint_fast32_t size)
 
void *(* ReallocAligned )(void *buffer, uint_fast32_t size, uint_fast32_t alignment)
 
void *(* Realloc )(void *buffer, uint_fast32_t size)
 
void(* Free )(void *buffer)
 
void(* Statistics )(vsf_heap_statistics_t *statistics)
 

Macro Definition Documentation

◆ VSF_HEAP_ALIGN

#define VSF_HEAP_ALIGN   (2 * sizeof(uintalu_t))

\NOTE: Make sure #include "utilities/ooc_class.h" is close to the class ! definition and there is NO ANY OTHER module-interface-header file ! included in this file

◆ vsf_heap_malloc_aligned

#define vsf_heap_malloc_aligned (   ...)
Value:
({ \
void * ptr = vsf_heap_malloc_aligned_imp(__VA_ARGS__); \
vsf_trace_debug("%s: malloc_align 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, ptr);\
ptr; \
})
void * vsf_heap_malloc_aligned_imp(uint_fast32_t size, uint_fast32_t alignment)
Definition vsf_heap.c:593
#define VSF_TRACE_CFG_LINEEND
Definition vsf_trace.h:47

◆ vsf_heap_malloc

#define vsf_heap_malloc (   ...)
Value:
({ \
void * ptr = vsf_heap_malloc_imp(__VA_ARGS__); \
vsf_trace_debug("%s: malloc 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, ptr);\
ptr; \
})
void * vsf_heap_malloc_imp(uint_fast32_t size)
Definition vsf_heap.c:606

◆ vsf_heap_realloc_aligned

#define vsf_heap_realloc_aligned (   ...)
Value:
({ \
void * ptr = vsf_heap_realloc_aligned_imp(__VA_ARGS__); \
vsf_trace_debug("%s: realloc_align 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, ptr);\
ptr; \
})
void * vsf_heap_realloc_aligned_imp(void *buffer, uint_fast32_t size, uint_fast32_t alignment)
Definition vsf_heap.c:619

◆ vsf_heap_realloc

#define vsf_heap_realloc (   ...)
Value:
({ \
void * ptr = vsf_heap_realloc_imp(__VA_ARGS__); \
vsf_trace_debug("%s: realloc 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, ptr);\
ptr; \
})
void * vsf_heap_realloc_imp(void *buffer, uint_fast32_t size)
Definition vsf_heap.c:642

◆ vsf_heap_free

#define vsf_heap_free (   __ptr)
Value:
({ \
vsf_trace_debug("%s: free 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, (__ptr));\
vsf_heap_free_imp(__ptr); \
})

◆ VSF_HEAP_CFG_STATISTICS

#define VSF_HEAP_CFG_STATISTICS   ENABLED

Typedef Documentation

◆ vsf_heap_statistics_t

Function Documentation

◆ __vsf_heap_add_buffer()

void __vsf_heap_add_buffer ( vsf_heap_t heap,
uint8_t buffer,
uint_fast32_t  size 
)
extern

◆ __vsf_heap_malloc_aligned()

void * __vsf_heap_malloc_aligned ( vsf_heap_t heap,
uint_fast32_t  size,
uint_fast32_t  alignment 
)
extern

◆ __vsf_heap_realloc_aligned()

void * __vsf_heap_realloc_aligned ( vsf_heap_t heap,
void *  buffer,
uint_fast32_t  size,
uint_fast32_t  alignment 
)
extern

◆ __vsf_heap_free()

void __vsf_heap_free ( vsf_heap_t heap,
void *  buffer 
)
extern

◆ __vsf_heap_size()

uint_fast32_t __vsf_heap_size ( vsf_heap_t heap,
void *  buffer 
)
extern

◆ __vsf_heap_statistics()

void __vsf_heap_statistics ( vsf_heap_t heap,
vsf_heap_statistics_t statistics 
)
extern

◆ vsf_heap_statistics()

void vsf_heap_statistics ( vsf_heap_statistics_t statistics)
extern

◆ vsf_heap_size()

uint_fast32_t vsf_heap_size ( uint8_t buffer)
extern

◆ vsf_heap_malloc_aligned_imp()

void * vsf_heap_malloc_aligned_imp ( uint_fast32_t  size,
uint_fast32_t  alignment 
)
extern

◆ vsf_heap_malloc_imp()

void * vsf_heap_malloc_imp ( uint_fast32_t  size)
extern

◆ vsf_heap_realloc_aligned_imp()

void * vsf_heap_realloc_aligned_imp ( void *  buffer,
uint_fast32_t  size,
uint_fast32_t  alignment 
)
extern

◆ vsf_heap_realloc_imp()

void * vsf_heap_realloc_imp ( void *  buffer,
uint_fast32_t  size 
)
extern

◆ vsf_heap_free_imp()

void vsf_heap_free_imp ( void *  buffer)
extern

◆ vsf_heap_calloc()

void * vsf_heap_calloc ( uint_fast32_t  n,
uint_fast32_t  size 
)
extern

◆ vsf_heap_strdup()

char * vsf_heap_strdup ( const char *  str)
extern

Variable Documentation

◆ alignment

uint_fast32_t alignment

◆ Malloc

void *(* Malloc) (uint_fast32_t size) ( uint_fast32_t  size)

◆ ReallocAligned

void *(* ReallocAligned) (void *buffer, uint_fast32_t size, uint_fast32_t alignment) ( void *  buffer,
uint_fast32_t  size,
uint_fast32_t  alignment 
)

◆ Realloc

void *(* Realloc) (void *buffer, uint_fast32_t size) ( void *  buffer,
uint_fast32_t  size 
)

◆ Free

void(* Free) (void *buffer) ( void *  buffer)

◆ Statistics

void(* Statistics) (vsf_heap_statistics_t *statistics) ( vsf_heap_statistics_t statistics)