summaryrefslogtreecommitdiff
path: root/lib/heap.c
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2025-01-23 00:24:57 +0000
committerAda Christine <adachristine18@gmail.com>2025-01-23 00:24:57 +0000
commitd855c0a219a180497c2e50f9bc19bfce69b937a6 (patch)
tree1ff8523d41b222fb356fb3404d2a53c26a7d6a3d /lib/heap.c
parentedd52bd1464ee9ae4f0cdf7ff90a20ca175580fe (diff)
it printfs with the efi interface
Diffstat (limited to 'lib/heap.c')
-rw-r--r--lib/heap.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/heap.c b/lib/heap.c
new file mode 100644
index 0000000..8331a17
--- /dev/null
+++ b/lib/heap.c
@@ -0,0 +1,39 @@
+#include <string.h>
+#include <stdlib.h>
+
+struct heap_node
+{
+ struct heap_node *next;
+ size_t size;
+};
+
+struct heap_head
+{
+ struct heap_node *first;
+ size_t total_bytes;
+ size_t ready_bytes;
+};
+
+void *malloc(size_t size)
+{
+ (void)size;
+ return nullptr;
+}
+
+void *calloc(size_t count, size_t size)
+{
+ void *block = malloc(count * size);
+
+ if (block != nullptr)
+ {
+ memset(block, 0, count * size);
+ }
+
+ return block;
+}
+
+void free(void *block)
+{
+ (void)block;
+}
+