feat/kernel: Added First-Fit algorithm for kernel heap
This commit is contained in:
parent
65fbb97d8a
commit
6374144f4a
6 changed files with 134 additions and 2 deletions
18
kernel/src/mm/heap/ff.h
Normal file
18
kernel/src/mm/heap/ff.h
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue