diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-10 17:33:18 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-10 17:33:29 +0200 |
| commit | a62dafea7b79f9226e34f2095b8533ebdd29f800 (patch) | |
| tree | eab20b0bac290d8f2a2e0c84bf9958ff327daedd /SDK/Library | |
| parent | 3529ed921748f953a19c872c8dc56c6813c995a6 (diff) | |
MHR-23: :boom: refactor heap API.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'SDK/Library')
| -rw-r--r-- | SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx | 6 | ||||
| -rw-r--r-- | SDK/Library/CoreSystem/Headers/Heap.h | 8 | ||||
| -rw-r--r-- | SDK/Library/CoreSystem/Sources/Heap.c | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx b/SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx index 6ed8fecf..7a8d8f92 100644 --- a/SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx +++ b/SDK/Library/CoreCxxRuntime/Sources/New+Delete.cxx @@ -13,7 +13,7 @@ void* operator new[](size_t sz) if (sz == 0) ++sz; - return RtTlsAllocate(sz, kStandardAllocation); + return RtHeapAllocate(sz, kStandardAllocation); } void* operator new(size_t sz) @@ -21,7 +21,7 @@ void* operator new(size_t sz) if (sz == 0) ++sz; - return RtTlsAllocate(sz, kArrayAllocation); + return RtHeapAllocate(sz, kArrayAllocation); } void operator delete[](void* ptr) @@ -29,5 +29,5 @@ void operator delete[](void* ptr) if (ptr == nullptr) return; - RtTlsFree(ptr); + RtHeapFree(ptr); }
\ No newline at end of file diff --git a/SDK/Library/CoreSystem/Headers/Heap.h b/SDK/Library/CoreSystem/Headers/Heap.h index 09cb15ee..0a02bb1a 100644 --- a/SDK/Library/CoreSystem/Headers/Heap.h +++ b/SDK/Library/CoreSystem/Headers/Heap.h @@ -20,20 +20,20 @@ enum RtAllocationKind /// @param sz the size /// @param flags the allocation flags. /// @return -CA_EXTERN_C PtrVoidType RtTlsAllocate(QWordType sz, +CA_EXTERN_C PtrVoidType RtHeapAllocate(QWordType sz, DWordType flags); /// @brief Check if the pointer exists. /// @param ptr the pointer to free. /// @return -CA_EXTERN_C BooleanType RtTlsPtrExists(PtrVoidType ptr); +CA_EXTERN_C BooleanType RtHeapPtrExists(PtrVoidType ptr); /// @brief Gets the size of the process' pointer. /// @param ptr the pointer to free. /// @return -CA_EXTERN_C QWordType RtTlsGetSize(PtrVoidType ptr); +CA_EXTERN_C QWordType RtHeapGetSize(PtrVoidType ptr); /// @brief Frees the process pointer. /// @param ptr the pointer to free. /// @return -CA_EXTERN_C VoidType RtTlsFree(PtrVoidType ptr); +CA_EXTERN_C VoidType RtHeapFree(PtrVoidType ptr); diff --git a/SDK/Library/CoreSystem/Sources/Heap.c b/SDK/Library/CoreSystem/Sources/Heap.c index 546384e2..f3e9f914 100644 --- a/SDK/Library/CoreSystem/Sources/Heap.c +++ b/SDK/Library/CoreSystem/Sources/Heap.c @@ -11,7 +11,7 @@ /// @param sz size of object. /// @param flags flags. /// @return -CA_EXTERN_C PtrVoidType RtTlsAllocate(QWordType sz, DWordType flags) +CA_EXTERN_C PtrVoidType RtHeapAllocate(QWordType sz, DWordType flags) { CA_MUST_PASS(kSharedApplication); CA_MUST_PASS(sz); @@ -23,7 +23,7 @@ CA_EXTERN_C PtrVoidType RtTlsAllocate(QWordType sz, DWordType flags) /// @brief Free pointer from the user's heap. /// @param ptr the pointer to free. -CA_EXTERN_C VoidType RtTlsFree(PtrVoidType ptr) +CA_EXTERN_C VoidType RtHeapFree(PtrVoidType ptr) { CA_MUST_PASS(kSharedApplication); CA_MUST_PASS(ptr); @@ -35,7 +35,7 @@ CA_EXTERN_C VoidType RtTlsFree(PtrVoidType ptr) /// @brief Get pointer size. /// @param ptr the pointer to find. /// @return the size. -CA_EXTERN_C QWordType RtTlsGetSize(PtrVoidType ptr) +CA_EXTERN_C QWordType RtHeapGetSize(PtrVoidType ptr) { CA_MUST_PASS(kSharedApplication); @@ -46,7 +46,7 @@ CA_EXTERN_C QWordType RtTlsGetSize(PtrVoidType ptr) /// @brief Check if the pointer exists. /// @param ptr the pointer to check. /// @return if it exists -CA_EXTERN_C BooleanType RtTlsPtrExists(PtrVoidType ptr) +CA_EXTERN_C BooleanType RtHeapPtrExists(PtrVoidType ptr) { CA_MUST_PASS(kSharedApplication); |
