aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarvin Borner2020-07-22 19:57:16 +0200
committerMarvin Borner2020-07-22 19:57:16 +0200
commite9c31cf19a30bd2d9960ce8341fea9cbfc973f7a (patch)
treee598da74f4fb51f926a929d0ae4fda8605d0b3f3 /src/lib
parent40cc5e32663cd0350b791b8e54825f564489343f (diff)
Added basic malloc (WARNING: DUMB!) :)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/inc/def.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/inc/def.h b/src/lib/inc/def.h
index 69b43e3..6e3066a 100644
--- a/src/lib/inc/def.h
+++ b/src/lib/inc/def.h
@@ -3,6 +3,10 @@
#ifndef DEF_H
#define DEF_H
+/**
+ * Types
+ */
+
typedef signed char s8;
typedef unsigned char u8;
@@ -15,6 +19,19 @@ typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
+/**
+ * Macros
+ */
+
#define NULL ((void *)0)
+#define malloc(n) ((void *)((HEAP += n) - n)) // TODO: Implement real/better malloc/free
+#define free(x)
+
+/**
+ * Heap
+ */
+
+extern u32 HEAP;
+extern u32 HEAP_START;
#endif