summaryrefslogtreecommitdiff
path: root/lib/heap.c
diff options
context:
space:
mode:
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;
+}
+