11#ifndef __TUYA_MEMORY_HEAP_H__
12#define __TUYA_MEMORY_HEAP_H__
14#include "tuya_cloud_types.h"
20#define MEM_HEAP_LIST_NUM (4)
23 void (*enter_critical)(void);
24 void (*exit_critical)(void);
25 void (*dbg_output)(
char* format, ...);
29 unsigned long total_size;
30 unsigned long free_size;
31 unsigned long free_watermark;
32 unsigned long max_free_block_size;
35typedef void* HEAP_HANDLE;
38int tuya_mem_heap_create(
void *start_addr,
unsigned int size, HEAP_HANDLE *handle);
39int tuya_mem_heap_delete(HEAP_HANDLE handle);
40void* tuya_mem_heap_malloc(HEAP_HANDLE handle,
unsigned int size);
41void* tuya_mem_heap_calloc(HEAP_HANDLE handle,
unsigned int size);
42void* tuya_mem_heap_realloc(HEAP_HANDLE handle,
void *ptr,
unsigned int size);
43void tuya_mem_heap_free(HEAP_HANDLE handle,
void *ptr);
44void tuya_mem_heap_state(HEAP_HANDLE handle,
heap_state_t *state);
45int tuya_mem_heap_available(HEAP_HANDLE handle);
47void* tuya_mem_heap_debug_malloc(HEAP_HANDLE handle,
unsigned int size,
char* filename,
int line);
48void* tuya_mem_heap_debug_calloc(HEAP_HANDLE handle,
unsigned int size,
char* filename,
int line);
49void* tuya_mem_heap_debug_realloc(HEAP_HANDLE handle,
void *ptr,
unsigned int size,
char* filename,
int line);
50int tuya_mem_heap_diagnose(HEAP_HANDLE handle);
Definition: tuya_mem_heap.h:22
Definition: tuya_mem_heap.h:28