1 2 3 4 5 6 7 8 9 10 11 12
#pragma once #include <stddef.h> #define PAGE_SIZE 4096 void mem_init(); // allocates `pages` consecutive pages void *page_alloc(size_t pages); // frees `pages` consecutive pages starting from *first void page_free(void *first, size_t pages);