Header files for heap.
More...
#include <stddef.h>
#include <basics.h>
Go to the source code of this file.
|
| void | mm_init (uintptr_t kernel_end, int64 heap_size) |
| | Function to initlialize heap.
|
| void | mm_extend (uint64_t additional_size) |
| | Function to extend available heap.
|
| void | mm_constrict (uint64_t removal_size) |
| | Function to constrict available heap.
|
|
void | mm_print_out () |
| | Prints out heap information.
|
| void * | kmalloc (size_t size) |
| | The main memory alloc function.
|
| void * | krealloc (void *ptr, size_t size) |
| | The main memory realloc function.
|
| void * | kmalloc_aligned (size_t size, size_t align) |
| void | kfree (void *ptr) |
| | The main free function for memory allocation.
|
|
|
uint64_t | heap_begin |
|
uint64_t | heap_end |
|
uint64_t | last_alloc |
|
uint64_t | alloc_count |
|
uint64_t | memory_used |
Header files for heap.
- Author
- Pradosh (prado.nosp@m.shga.nosp@m.me@gm.nosp@m.ail..nosp@m.com)
- Version
- 0.1
- Date
- 2023-11-10
- Copyright
- Copyright (c) Pradosh 2023
Definition in file heap.h.
◆ kfree()
The main free function for memory allocation.
- Parameters
-
◆ kmalloc()
| void * kmalloc |
( |
size_t | size | ) |
|
|
extern |
The main memory alloc function.
- Parameters
-
| size | Amount of size needed to be allocated. |
- Returns
- void* Location in memory.
◆ kmalloc_aligned()
| void * kmalloc_aligned |
( |
size_t | size, |
|
|
size_t | align ) |
◆ krealloc()
| void * krealloc |
( |
void * | ptr, |
|
|
size_t | size ) |
|
extern |
The main memory realloc function.
- Parameters
-
| size | Amount of size needed to be extened. |
- Returns
- void* Location in memory.
◆ mm_constrict()
| void mm_constrict |
( |
uint64_t | removal_size | ) |
|
|
extern |
Function to constrict available heap.
- Parameters
-
| removal_size | Amount of size needed to be reduced. |
◆ mm_extend()
| void mm_extend |
( |
uint64_t | additional_size | ) |
|
|
extern |
Function to extend available heap.
- Parameters
-
| additional_size | Additional size to be added. |
◆ mm_init()
| void mm_init |
( |
uintptr_t | kernel_end, |
|
|
int64 | heap_size ) |
|
extern |
Function to initlialize heap.
- Parameters
-
| kernel_end | The position in memory where kernel ends. |
| heap_size | The size of heap allocated. |