summaryrefslogtreecommitdiffhomepage
path: root/Public/Developer/System.Cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Public/Developer/System.Cxx')
-rw-r--r--Public/Developer/System.Cxx/.gitkeep0
-rw-r--r--Public/Developer/System.Cxx/Sources/New+Delete.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/Public/Developer/System.Cxx/.gitkeep b/Public/Developer/System.Cxx/.gitkeep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Public/Developer/System.Cxx/.gitkeep
diff --git a/Public/Developer/System.Cxx/Sources/New+Delete.cxx b/Public/Developer/System.Cxx/Sources/New+Delete.cxx
new file mode 100644
index 00000000..b54b5ea8
--- /dev/null
+++ b/Public/Developer/System.Cxx/Sources/New+Delete.cxx
@@ -0,0 +1,27 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
+#include <System.Core/Headers/Heap.h>
+
+typedef SizeType size_t;
+
+void* operator new[](size_t sz) {
+ if (sz == 0) ++sz;
+
+ return RtAllocateProcessPtr(sz, kStandardAllocation);
+}
+
+void* operator new(size_t sz) {
+ if (sz == 0) ++sz;
+
+ return RtAllocateProcessPtr(sz, kArrayAllocation);
+}
+
+void operator delete[](void* ptr) {
+ if (ptr == nullptr) return;
+
+ RtFreeProcessPtr(ptr);
+} \ No newline at end of file