Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Data Structures | Macros | Functions
mm.h File Reference
#include <stddef.h>
#include <stdint.h>
Include dependency graph for mm.h:

Go to the source code of this file.

Data Structures

struct  kmalloc_header
 
struct  kmalloc_slab_info
 

Macros

#define DEF_KMALLOC_SLAB(_size)
 
#define KMALLOC_SLAB_TABLE_SIZE    (sizeof(kmalloc_slab_info) / sizeof(struct kmalloc_slab_info))
 

Functions

void * kmalloc (size_t size)
 Allocate a memory space for using in the kernel. More...
 
void kfree (void *ptr)
 Free the memory space pointed to by ptr. More...
 
unsigned long heap_get_total_size (void)
 
unsigned long heap_get_free_size (void)
 
void heap_init (void)
 
void * __malloc (size_t size)
 
void __free (void *ptr)
 

Macro Definition Documentation

◆ DEF_KMALLOC_SLAB

#define DEF_KMALLOC_SLAB (   _size)
Value:
{ \
.size = _size, .name = "kmalloc-" #_size \
}

Function Documentation

◆ kfree()

void kfree ( void *  ptr)

Free the memory space pointed to by ptr.

Parameters
ptrPointer to the allocated memory.
Return values
None

◆ kmalloc()

void* kmalloc ( size_t  size)

Allocate a memory space for using in the kernel.

Parameters
sizeThe size of the memory in bytes.
Return values
None