diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-07 14:46:11 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-07 14:47:44 +0200 |
| commit | e80b274a23cb6bbe83bc48058c779624b16dd556 (patch) | |
| tree | 905578ee29d9c5bad03b28b8381a2c29fb715f0f /Public/Developer/CxxRuntimeLib | |
| parent | c4f3bfd671ad8ec5721c3d2c45de4806f34ebb75 (diff) | |
MHR-23: ErrorID error codes are now deprecated in favor of HError.
- Cleanup done in SystemLib.
- Refactor system API.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
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 |
