diff options
Diffstat (limited to 'SDK/Library/CoreCxxRuntime')
| -rw-r--r-- | SDK/Library/CoreCxxRuntime/.gitkeep | 0 | ||||
| -rw-r--r-- | SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx | 33 |
2 files changed, 33 insertions, 0 deletions
diff --git a/SDK/Library/CoreCxxRuntime/.gitkeep b/SDK/Library/CoreCxxRuntime/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/SDK/Library/CoreCxxRuntime/.gitkeep diff --git a/SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx b/SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx new file mode 100644 index 00000000..6ed8fecf --- /dev/null +++ b/SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx @@ -0,0 +1,33 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + +------------------------------------------- */ + +#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 |
