make dmm.c portable
[lunaix-os.git] / lunaix-os / includes / lunaix / mm / dmm.h
1 #ifndef __LUNAIX_DMM_H
2 #define __LUNAIX_DMM_H
3 // Dynamic Memory (i.e., heap) Manager
4
5 #include <stddef.h>
6
7 #define HEAP_INIT_SIZE 4096
8
9 typedef struct 
10 {
11     void* start;
12     void* brk;
13 } heap_context_t;
14
15
16 int
17 dmm_init(heap_context_t* heap);
18
19 int
20 lxsbrk(heap_context_t* heap, void* addr);
21 void*
22 lxbrk(heap_context_t* heap, size_t size);
23
24 void*
25 lx_malloc(heap_context_t* heap, size_t size);
26
27 void
28 lx_free(void* ptr);
29
30 #endif /* __LUNAIX_DMM_H */