summaryrefslogtreecommitdiff
path: root/src/kernel/mem/heap.basic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/mem/heap.basic.h')
-rw-r--r--src/kernel/mem/heap.basic.h30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/kernel/mem/heap.basic.h b/src/kernel/mem/heap.basic.h
deleted file mode 100644
index b52be4e..0000000
--- a/src/kernel/mem/heap.basic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef DEF_HEAP_H
-#define DEF_HEAP_H
-
-/* This heap implementation is extra-simple and extra-slow. */
-
-#include <types.h>
-
-#define HH_FREE_MAGIC 0xFEE0FEE0
-#define HH_ALLOC_MAGIC 0xA110A110
-
-#define HEAP_EXTEND_QUANTITY 0x00080000 // each time we extend the heap, extend it 512 k
-
-#define MIN_BLK_SIZE 0x20 // 32 bytes
-
-struct heap_header {
- uint32_t magic;
- struct heap_header *prev, *next;
-};
-
-struct heap {
- struct heap_header *first, *first_free; // first_free is not necessarily free, it's just an indication
- size_t start_addr, end_addr, max_end;
- uint32_t mutex;
-};
-
-void heap_create(struct heap *heap, size_t start, size_t datasize, size_t maxdatasize);
-void *heap_alloc(struct heap *heap, size_t sz);
-void heap_free(struct heap *heap, void *ptr);
-
-#endif