From ccf807eb4ff541bb849c4f370d34123cb23d7d76 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 18 Oct 2009 18:39:52 +0200 Subject: Heap included as well in userland library --- Source/Library/Userland/common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Source/Library/Userland/common.h') diff --git a/Source/Library/Userland/common.h b/Source/Library/Userland/common.h index 27218f7..3508513 100644 --- a/Source/Library/Userland/common.h +++ b/Source/Library/Userland/common.h @@ -7,4 +7,20 @@ #include +namespace Mem { + void* alloc(u32int); + void free(void*); +} + +//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 -- cgit v1.2.3