1
0
Fork 0

feat/kernel: Added First-Fit algorithm for kernel heap

This commit is contained in:
Kevin Alavik 2025-05-15 19:52:40 +02:00
parent 65fbb97d8a
commit 6374144f4a
Signed by: cmpsb
GPG key ID: 10D1CC0526FDC6D7
6 changed files with 134 additions and 2 deletions

18
kernel/src/mm/heap/ff.h Normal file
View file

@ -0,0 +1,18 @@
/* EMK 1.0 Copyright (c) 2025 Piraterna */
#ifndef FF_H
#define FF_H
/* Kevin's simple First-Fit allocator */
#include <stdint.h>
#include <stddef.h>
#define FF_POOL_SIZE 512 // 2MB, in pages
typedef struct block
{
size_t size;
struct block *next;
} block_t;
#endif // FF_H