diff options
Diffstat (limited to 'Public/Developer/CxxRuntimeLib')
| -rw-r--r-- | Public/Developer/CxxRuntimeLib/.gitkeep | 0 | ||||
| -rw-r--r-- | Public/Developer/CxxRuntimeLib/Sources/New+Delete.cxx | 33 |
2 files changed, 33 insertions, 0 deletions
diff --git a/Public/Developer/CxxRuntimeLib/.gitkeep b/Public/Developer/CxxRuntimeLib/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Public/Developer/CxxRuntimeLib/.gitkeep diff --git a/Public/Developer/CxxRuntimeLib/Sources/New+Delete.cxx b/Public/Developer/CxxRuntimeLib/Sources/New+Delete.cxx new file mode 100644 index 00000000..5ff3612f --- /dev/null +++ b/Public/Developer/CxxRuntimeLib/Sources/New+Delete.cxx @@ -0,0 +1,33 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#include <Headers/Heap.h> + +typedef SizeType size_t; + +void* operator new[](size_t sz) +{ + if (sz == 0) + ++sz; + + return RtTlsAllocate(sz, kStandardAllocation); +} + +void* operator new(size_t sz) +{ + if (sz == 0) + ++sz; + + return RtTlsAllocate(sz, kArrayAllocation); +} + +void operator delete[](void* ptr) +{ + if (ptr == nullptr) + return; + + RtTlsFree(ptr); +}
\ No newline at end of file |
