TuyaOS
tuya_mem_heap.h
浏览该文件的文档.
1
11#ifndef __TUYA_MEMORY_HEAP_H__
12#define __TUYA_MEMORY_HEAP_H__
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#define MEM_HEAP_LIST_NUM (4)
19
20typedef struct {
21 void (*enter_critical)(void);
22 void (*exit_critical)(void);
23 void (*dbg_output)(char* format, ...);
25
26typedef void* HEAP_HANDLE;
27
28int tuya_mem_heap_init(heap_context_t *ctx);
29int tuya_mem_heap_create(void *start_addr, unsigned int size, HEAP_HANDLE *handle);
30int tuya_mem_heap_delete(HEAP_HANDLE handle);
31void* tuya_mem_heap_malloc(HEAP_HANDLE handle, unsigned int size);
32void* tuya_mem_heap_calloc(HEAP_HANDLE handle, unsigned int size);
33void* tuya_mem_heap_realloc(HEAP_HANDLE handle, void *ptr, unsigned int size);
34void tuya_mem_heap_free(HEAP_HANDLE handle, void *ptr);
35int tuya_mem_heap_available(HEAP_HANDLE handle);
36
37void* tuya_mem_heap_debug_malloc(HEAP_HANDLE handle, unsigned int size, char* filename, int line);
38void* tuya_mem_heap_debug_calloc(HEAP_HANDLE handle, unsigned int size, char* filename, int line);
39void* tuya_mem_heap_debug_realloc(HEAP_HANDLE handle, void *ptr, unsigned int size, char* filename, int line);
40int tuya_mem_heap_diagnose(HEAP_HANDLE handle);
41
42#ifdef __cplusplus
43}
44#endif
45
46#endif //__TUYA_MEMORY_HEAP_H__
47
Definition: tuya_mem_heap.h:20