diff options
Diffstat (limited to 'Public/SDK/System.Core/Sources')
| -rw-r--r-- | Public/SDK/System.Core/Sources/Heap.cxx | 8 | ||||
| -rw-r--r-- | Public/SDK/System.Core/Sources/LibEntrypoint.cxx (renamed from Public/SDK/System.Core/Sources/DllMain.cxx) | 4 | ||||
| -rw-r--r-- | Public/SDK/System.Core/Sources/New+Delete.cxx | 24 |
3 files changed, 12 insertions, 24 deletions
diff --git a/Public/SDK/System.Core/Sources/Heap.cxx b/Public/SDK/System.Core/Sources/Heap.cxx index 3803af3a..18106f41 100644 --- a/Public/SDK/System.Core/Sources/Heap.cxx +++ b/Public/SDK/System.Core/Sources/Heap.cxx @@ -60,24 +60,24 @@ HeapInterface* HeapInterface::Shared() noexcept { } HeapInterface::HeapInterface() { - CA_MUST_PASS(HcProcessHeapExists(kInstanceObject, (PtrVoidType)this)); + CA_MUST_PASS(HcProcessHeapExists(kApplicationObject, (PtrVoidType)this)); } HeapInterface::~HeapInterface() { delete this; } void HeapInterface::Delete(PtrHeapType me) noexcept { CA_MUST_PASS(me); - HcFreeProcessHeap(kInstanceObject, me); + HcFreeProcessHeap(kApplicationObject, me); } SizeType HeapInterface::Size(PtrHeapType me) noexcept { CA_MUST_PASS(me); - return HcProcessHeapSize(kInstanceObject, me); + return HcProcessHeapSize(kApplicationObject, me); } PtrHeapType HeapInterface::New(const SizeType& sz, const DWordType flags) { SizeType _sz = sz; if (!_sz) ++_sz; - return HcAllocateProcessHeap(kInstanceObject, _sz, flags); + return HcAllocateProcessHeap(kApplicationObject, _sz, flags); } diff --git a/Public/SDK/System.Core/Sources/DllMain.cxx b/Public/SDK/System.Core/Sources/LibEntrypoint.cxx index 9412cbbb..b874ef55 100644 --- a/Public/SDK/System.Core/Sources/DllMain.cxx +++ b/Public/SDK/System.Core/Sources/LibEntrypoint.cxx @@ -7,8 +7,8 @@ /// @brief Inits the DLL. /// @return if it was succesful or not. DWordType __DllMain(VoidType) { - kInstanceObject = HcGetInstanceObject(); - CA_MUST_PASS(kInstanceObject); + kApplicationObject = HcGetInstanceObject(); + CA_MUST_PASS(kApplicationObject); return 0; }
\ No newline at end of file diff --git a/Public/SDK/System.Core/Sources/New+Delete.cxx b/Public/SDK/System.Core/Sources/New+Delete.cxx index fe8ed43f..678aacce 100644 --- a/Public/SDK/System.Core/Sources/New+Delete.cxx +++ b/Public/SDK/System.Core/Sources/New+Delete.cxx @@ -5,44 +5,32 @@ ------------------------------------------- */ #include <System.Core/Headers/Heap.hxx> - -#define kAllocationTypes 2 - -enum HcAllocationKind { - kStandardAllocation = 0xC, - kArrayAllocation = 0xD, -}; - -CA_EXTERN_C PtrVoidType HcAllocateProcessHeap(ObjectPtr refObj, QWordType sz, - DWordType flags); -CA_EXTERN_C BooleanType HcProcessHeapExists(ObjectPtr refObj, PtrVoidType ptr); -CA_EXTERN_C QWordType HcProcessHeapSize(ObjectPtr refObj, PtrVoidType ptr); -CA_EXTERN_C VoidType HcFreeProcessHeap(ObjectPtr refObj, PtrVoidType ptr); +#include <System.Core/Headers/Heap.hxx> typedef SizeType size_t; void* operator new[](size_t sz) { if (sz == 0) ++sz; - return HcAllocateProcessHeap(kInstanceObject, sz, kStandardAllocation); + return HcAllocateProcessHeap(kApplicationObject, sz, kStandardAllocation); } void* operator new(size_t sz) { if (sz == 0) ++sz; - return HcAllocateProcessHeap(kInstanceObject, sz, kArrayAllocation); + return HcAllocateProcessHeap(kApplicationObject, sz, kArrayAllocation); } void operator delete[](void* ptr) { if (ptr == nullptr) return; - HcFreeProcessHeap(kInstanceObject, ptr); + HcFreeProcessHeap(kApplicationObject, ptr); } void operator delete(void* ptr) { if (ptr == nullptr) return; - HcFreeProcessHeap(kInstanceObject, ptr); + HcFreeProcessHeap(kApplicationObject, ptr); } void operator delete(void* ptr, size_t sz) { @@ -50,5 +38,5 @@ void operator delete(void* ptr, size_t sz) { (void)sz; - HcFreeProcessHeap(kInstanceObject, ptr); + HcFreeProcessHeap(kApplicationObject, ptr); } |
