24#if VSF_USE_HEAP == ENABLED
29#if VSF_HEAP_CFG_TRACE == ENABLED
38#if defined(__VSF_HEAP_CLASS_IMPLEMENT)
39# define __VSF_CLASS_IMPLEMENT__
40# undef __VSF_HEAP_CLASS_IMPLEMENT
41#elif defined(__VSF_HEAP_CLASS_INHERIT__)
42# define __VSF_CLASS_INHERIT__
43# undef __VSF_HEAP_CLASS_INHERIT__
54#if !defined(VSF_HEAP_SIZE) && VSF_ARCH_PROVIDE_HEAP != ENABLED && !defined(__VSF_APPLET__)
55# warning VSF_HEAP_SIZE is not defined, use 128K as default
56# define VSF_HEAP_SIZE (128 * 1024)
60# define VSF_HEAP_ALIGN (2 * sizeof(uintalu_t))
63#if VSF_HEAP_CFG_TRACE == ENABLED
64# define vsf_heap_malloc_aligned(...) \
66 void * ptr = vsf_heap_malloc_aligned_imp(__VA_ARGS__); \
67 vsf_trace_debug("%s: malloc_align 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, ptr);\
70# define vsf_heap_malloc(...) \
72 void * ptr = vsf_heap_malloc_imp(__VA_ARGS__); \
73 vsf_trace_debug("%s: malloc 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, ptr);\
76# define vsf_heap_realloc_aligned(...) \
78 void * ptr = vsf_heap_realloc_aligned_imp(__VA_ARGS__); \
79 vsf_trace_debug("%s: realloc_align 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, ptr);\
82# define vsf_heap_realloc(...) \
84 void * ptr = vsf_heap_realloc_imp(__VA_ARGS__); \
85 vsf_trace_debug("%s: realloc 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, ptr);\
88# define vsf_heap_free(__ptr) \
90 vsf_trace_debug("%s: free 0x%p" VSF_TRACE_CFG_LINEEND, __FUNCTION__, (__ptr));\
91 vsf_heap_free_imp(__ptr); \
94# define vsf_heap_malloc_aligned vsf_heap_malloc_aligned_imp
95# define vsf_heap_malloc vsf_heap_malloc_imp
96# define vsf_heap_realloc_aligned vsf_heap_realloc_aligned_imp
97# define vsf_heap_realloc vsf_heap_realloc_imp
98# define vsf_heap_free vsf_heap_free_imp
101#ifndef VSF_HEAP_CFG_STATISTICS
102# define VSF_HEAP_CFG_STATISTICS ENABLED
107#if VSF_HEAP_CFG_STATISTICS == ENABLED
130#if VSF_ARCH_PROVIDE_HEAP != ENABLED
140#if (VSF_HEAP_CFG_STATISTICS == ENABLED) \
141 && ( (VSF_ARCH_PROVIDE_HEAP != ENABLED) \
142 || (VSF_ARCH_HEAP_HAS_STATISTICS == ENABLED))
160#if VSF_HEAP_CFG_STATISTICS == ENABLED
164#if VSF_ARCH_PROVIDE_HEAP != ENABLED
166extern void vsf_heap_init(
void);
172extern void vsf_heap_add_memory(
vsf_mem_t mem);
174#if (VSF_HEAP_CFG_STATISTICS == ENABLED) \
175 && ( (VSF_ARCH_PROVIDE_HEAP != ENABLED) \
176 || (VSF_ARCH_HEAP_HAS_STATISTICS == ENABLED))
#define ENABLED
Definition __type.h:28
def_interface(i_adc_t) i_peripheral_t
vsf_err_t(* Init)(vsf_adc_cfg_t *pCfg)
Definition adc_interface.h:38
Definition vsf_heap.h:114
end_def_interface(i_pm_wakeup_t) struct vsf_pm_pclk_cfg_t
Definition device.h:249
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned int uint_fast32_t
Definition stdint.h:27
Definition vsf_list.h:883
Definition vsf_heap.h:108
uint32_t all_size
Definition vsf_heap.h:109
uint32_t used_size
Definition vsf_heap.h:110
Definition vsf_utilities.h:51
const i_heap_t VSF_HEAP
Definition vsf_heap.c:110
void * vsf_heap_malloc_aligned_imp(uint_fast32_t size, uint_fast32_t alignment)
Definition vsf_heap.c:594
uint_fast32_t vsf_heap_size(uint8_t *buffer)
Definition vsf_heap.c:668
#define VSF_HEAP_CFG_STATISTICS
Definition vsf_heap.h:102
void(* Statistics)(vsf_heap_statistics_t *statistics)
Definition vsf_heap.h:143
uint_fast32_t __vsf_heap_size(vsf_heap_t *heap, void *buffer)
Definition vsf_heap.c:500
void * vsf_heap_calloc(uint_fast32_t n, uint_fast32_t size)
Definition vsf_heap.c:688
void * __vsf_heap_realloc_aligned(vsf_heap_t *heap, void *buffer, uint_fast32_t size, uint_fast32_t alignment)
Definition vsf_heap.c:440
void vsf_heap_free_imp(void *buffer)
Definition vsf_heap.c:677
void vsf_heap_statistics(vsf_heap_statistics_t *statistics)
Definition vsf_heap.c:581
uint_fast32_t alignment
Definition vsf_heap.h:135
void(* Free)(void *buffer)
Definition vsf_heap.h:139
void * vsf_heap_realloc_imp(void *buffer, uint_fast32_t size)
Definition vsf_heap.c:643
void __vsf_heap_statistics(vsf_heap_t *heap, vsf_heap_statistics_t *statistics)
Definition vsf_heap.c:529
void * vsf_heap_realloc_aligned_imp(void *buffer, uint_fast32_t size, uint_fast32_t alignment)
Definition vsf_heap.c:620
void * vsf_heap_malloc_imp(uint_fast32_t size)
Definition vsf_heap.c:607
void * __vsf_heap_malloc_aligned(vsf_heap_t *heap, uint_fast32_t size, uint_fast32_t alignment)
Definition vsf_heap.c:419
char * vsf_heap_strdup(const char *str)
Definition vsf_heap.c:698
void __vsf_heap_free(vsf_heap_t *heap, void *buffer)
Definition vsf_heap.c:514
void __vsf_heap_add_buffer(vsf_heap_t *heap, uint8_t *buffer, uint_fast32_t size)
Definition vsf_heap.c:376
uint32_t size
Definition vsf_memfs.h:50
declare_interface(i_msg_tree_node_t) def_interface(i_msg_tree_node_t) vsf_msgt_handler_t msg_handler