summaryrefslogtreecommitdiffhomepage
path: root/SDK/Libraries/CoreCxxRuntime
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-06-06 10:27:55 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-06-06 10:27:55 +0000
commit4e75e05a20ddd0dbca982e8f3bc2ea8043ed3a3f (patch)
tree95409c0e32b644578b94a5c230417da684d79dc9 /SDK/Libraries/CoreCxxRuntime
parentf5081a8f9a8537ad5be5d639955cd1d0e68a9e1d (diff)
parent9994b8f3f88131f41be1061fb0947177e66dc7b0 (diff)
Merged in MHR-23 (pull request #14)
Draft: MHR-23
Diffstat (limited to 'SDK/Libraries/CoreCxxRuntime')
-rw-r--r--SDK/Libraries/CoreCxxRuntime/.gitkeep0
-rw-r--r--SDK/Libraries/CoreCxxRuntime/Private.xml3
-rw-r--r--SDK/Libraries/CoreCxxRuntime/Sources/New+Delete.cxx33
3 files changed, 36 insertions, 0 deletions
diff --git a/SDK/Libraries/CoreCxxRuntime/.gitkeep b/SDK/Libraries/CoreCxxRuntime/.gitkeep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/SDK/Libraries/CoreCxxRuntime/.gitkeep
diff --git a/SDK/Libraries/CoreCxxRuntime/Private.xml b/SDK/Libraries/CoreCxxRuntime/Private.xml
new file mode 100644
index 00000000..7ee426c0
--- /dev/null
+++ b/SDK/Libraries/CoreCxxRuntime/Private.xml
@@ -0,0 +1,3 @@
+<SourceDeploy>
+ <Ignore/>
+</SourceDeploy> \ No newline at end of file
diff --git a/SDK/Libraries/CoreCxxRuntime/Sources/New+Delete.cxx b/SDK/Libraries/CoreCxxRuntime/Sources/New+Delete.cxx
new file mode 100644
index 00000000..cc59586f
--- /dev/null
+++ b/SDK/Libraries/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 RtHeapAllocate(sz, kStandardAllocation);
+}
+
+void* operator new(size_t sz)
+{
+ if (sz == 0)
+ ++sz;
+
+ return RtHeapAllocate(sz, kArrayAllocation);
+}
+
+void operator delete[](void* ptr)
+{
+ if (ptr == nullptr)
+ return;
+
+ RtHeapFree(ptr);
+} \ No newline at end of file