diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-05-27 20:45:46 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-05-27 20:45:46 +0200 |
| commit | 9db58da40cfcb6643412bfae25aefc0cd1077f9d (patch) | |
| tree | c6664fc649968ca1be7ddc59dfe3e9a7dd0f3ebc /SDK/Libraries/CoreCxxRuntime | |
| parent | ce84bea215424ff36a2c18cab67835edfa8f71b5 (diff) | |
MHR-23: Improve project structure, make it better.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'SDK/Libraries/CoreCxxRuntime')
| -rw-r--r-- | SDK/Libraries/CoreCxxRuntime/.gitkeep | 0 | ||||
| -rw-r--r-- | SDK/Libraries/CoreCxxRuntime/Private.xml | 3 | ||||
| -rw-r--r-- | SDK/Libraries/CoreCxxRuntime/Sources/New+Delete.cxx | 33 |
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 |
