diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-18 18:39:52 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-18 18:39:52 +0200 |
commit | ccf807eb4ff541bb849c4f370d34123cb23d7d76 (patch) | |
tree | 7f97fcf3f83ef1efcdc0ae72e11aab1f8332a667 /Source/Library/Userland/common.h | |
parent | eb7b832d47bcbd74181028c62e871d407ba63a23 (diff) | |
download | Melon-ccf807eb4ff541bb849c4f370d34123cb23d7d76.tar.gz Melon-ccf807eb4ff541bb849c4f370d34123cb23d7d76.zip |
Heap included as well in userland library
Diffstat (limited to 'Source/Library/Userland/common.h')
-rw-r--r-- | Source/Library/Userland/common.h | 16 |
1 files changed, 16 insertions, 0 deletions
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 <CMem.ns.h> +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 |