diff options
author | Anton Kling <anton@kling.gg> | 2023-10-27 19:39:54 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-10-30 21:49:48 +0100 |
commit | 715274d3a77c58510b97c3f87cd604dde9de7a4f (patch) | |
tree | f3f71248419f3395badc1b3bd9f64bd63dc3ae8c /kmalloc.c | |
parent | 8eede5fd642db2c56a1f5185973815fbd2b0afa4 (diff) |
Kernel: Move min, max functions to their own file
Diffstat (limited to 'kmalloc.c')
-rw-r--r-- | kmalloc.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -1,6 +1,7 @@ #include <assert.h> #include <kmalloc.h> #include <ksbrk.h> +#include <math.h> #define NEW_ALLOC_SIZE 0x30000 #define IS_FREE (1 << 0) @@ -13,10 +14,6 @@ typedef struct MallocHeader { struct MallocHeader *n; } MallocHeader; -size_t max(size_t a, size_t b) { return (a > b) ? a : b; } - -size_t min(size_t a, size_t b) { return (a < b) ? a : b; } - uint64_t delta_page(uint64_t a) { return 0x1000 - (a % 0x1000); } MallocHeader *head = NULL; |