Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
mm.h
Go to the documentation of this file.
1 
4 #ifndef __MM_H__
5 #define __MM_H__
6 
7 #include <stddef.h>
8 #include <stdint.h>
9 
10 #define DEF_KMALLOC_SLAB(_size) \
11  { \
12  .size = _size, .name = "kmalloc-" #_size \
13  }
14 
15 #define KMALLOC_SLAB_TABLE_SIZE \
16  (sizeof(kmalloc_slab_info) / sizeof(struct kmalloc_slab_info))
17 
19  size_t size;
20 };
21 
23  char *name;
24  size_t size;
25 };
26 
32 void *kmalloc(size_t size);
33 
39 void kfree(void *ptr);
40 
41 unsigned long heap_get_total_size(void);
42 unsigned long heap_get_free_size(void);
43 void heap_init(void);
44 void *__malloc(size_t size);
45 void __free(void *ptr);
46 
47 #endif
void kfree(void *ptr)
Free the memory space pointed to by ptr.
Definition: kernel.c:226
void * kmalloc(size_t size)
Allocate a memory space for using in the kernel.
Definition: kernel.c:180
Definition: mm.h:18
Definition: mm.h:22