Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
0x9u committed Jan 15, 2025
1 parent a81f8b8 commit 02e929e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/src/arch/x86_64/memory/heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void *kmalloc(size_t size) {
if (new_address == NULL) return new_address;
new = allocate_free_block(new_address, size, NULL, before);
before->next = new;

return get_heap_address(new);
}

Expand Down
3 changes: 3 additions & 0 deletions kernel/src/arch/x86_64/memory/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include <stdint.h>
#include <stddef.h>

// Initialises the heap by mapping it in virtual memory.
void heap_init(uint64_t *pml4);
// Allocates memory from a specified size.
void *kmalloc(size_t size);
// Frees the memory allocated from heap.
void free(void *address);

0 comments on commit 02e929e

Please sign in to comment.