summaryrefslogtreecommitdiffstats
path: root/lib/libc-jove/stdlib/heap.h
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-08-24 16:05:30 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-08-24 16:05:30 -0400
commitf0248ad1724f9fbdd372db4da8ee8f956ae6aacd (patch)
tree4d661f264a64c562b56a801d3b6a5373415e42d4 /lib/libc-jove/stdlib/heap.h
parent18c389411a0f6283c1b6dffc78bbcfcb237e367b (diff)
downloadjove-os-f0248ad1724f9fbdd372db4da8ee8f956ae6aacd.tar.gz
jove-os-f0248ad1724f9fbdd372db4da8ee8f956ae6aacd.tar.bz2
jove-os-f0248ad1724f9fbdd372db4da8ee8f956ae6aacd.zip
libc heap impl
Diffstat (limited to 'lib/libc-jove/stdlib/heap.h')
-rw-r--r--lib/libc-jove/stdlib/heap.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/libc-jove/stdlib/heap.h b/lib/libc-jove/stdlib/heap.h
new file mode 100644
index 0000000..9628444
--- /dev/null
+++ b/lib/libc-jove/stdlib/heap.h
@@ -0,0 +1,19 @@
+#ifndef _LIBC_JOVE_HEAP_H
+#define _LIBC_JOVE_HEAP_H 1
+
+#include <stdint.h>
+#include <stddef.h>
+
+#define LIBC_HEAP_INIT_SIZE (0x1000)
+#define LIBC_HEAP_MINALLOC (0x10)
+#define LIBC_HEAP_MINSPLIT (sizeof(heap_bin_t) + sizeof(uintptr_t) + LIBC_HEAP_MINALLOC)
+
+typedef struct heap_bin {
+ struct heap_bin *next;
+ size_t size_taken;
+ char data[];
+} heap_bin_t;
+
+void __libc_heap_init(uintptr_t program_end);
+
+#endif