mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
mem-slab.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
54 #ifndef MEM_SLAB_H
55 #define MEM_SLAB_H
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 MGNCS_EXPORT void* slab_new_heap(int min_size, int max_size);
62 
63 MGNCS_EXPORT void slab_free_heap(void *heap);
64 
65 MGNCS_EXPORT void* slab_new_mem(void *heap, int size, int padding);
66 
67 MGNCS_EXPORT void slab_free_mem(void *heap, void *p);
68 
69 MGNCS_EXPORT int slab_init_default_heap(void);
70 
71 MGNCS_EXPORT void slab_unit_default_heap(void);
72 
73 #define _SLAB_ALLOC(size) slab_new_mem(NULL, (size), 0)
74 #define _SLAB_FREE(p) slab_free_mem(NULL, p)
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif
81 
82