summaryrefslogtreecommitdiff
path: root/Source/Library/Userland/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Userland/common.h')
-rw-r--r--Source/Library/Userland/common.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Library/Userland/common.h b/Source/Library/Userland/common.h
new file mode 100644
index 0000000..6257841
--- /dev/null
+++ b/Source/Library/Userland/common.h
@@ -0,0 +1,27 @@
+#ifndef DEF_COMMON
+#define DEF_COMMON
+
+#define NULL 0
+
+#include <types.h>
+
+#include <CMem.ns.h>
+
+namespace Mem {
+ void* alloc(u32int);
+ void free(void*);
+ void* mkXchgSpace(u32int sz);
+}
+
+//Standard implemenations of operator new/delete
+inline void* operator new(u32int, void *p) { return p; }
+inline void* operator new[](u32int, void *p) { return p; }
+inline void operator delete(void*, void*) { }
+inline void operator delete[](void*, void*) { }
+
+inline void* operator new(u32int sz) { return Mem::alloc(sz); }
+inline void* operator new[](u32int sz) { return Mem::alloc(sz); }
+inline void operator delete(void *ptr) { Mem::free(ptr); }
+inline void operator delete[](void *ptr) { Mem::free(ptr); }
+
+#endif