22 lines
346 B
C
22 lines
346 B
C
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
extern struct Heap_Metadata global_heap;
|
|
|
|
struct Heap_Metadata {
|
|
struct Heap_Block* start;
|
|
size_t size;
|
|
};
|
|
|
|
struct Heap_Block {
|
|
struct Heap_Block* next;
|
|
size_t size;
|
|
bool used;
|
|
void* data;
|
|
};
|
|
|
|
void heap_init();
|
|
void* malloc(size_t size);
|
|
void free(void *ptr);
|