diff --git a/Include/Aurora/Memory/Heap.hpp b/Include/Aurora/Memory/Heap.hpp index dab33f20..2887b36b 100644 --- a/Include/Aurora/Memory/Heap.hpp +++ b/Include/Aurora/Memory/Heap.hpp @@ -377,6 +377,7 @@ namespace Aurora::Memory protected: friend struct ProxyHeap; + friend struct HeapAccessor; virtual AuSPtr GetSelfReference() = 0; // may return empty/default. not all heaps are sharable. virtual Heap *GetSelfReferenceRaw() = 0; @@ -392,6 +393,19 @@ namespace Aurora::Memory virtual void _Free(void* pBase) = 0; }; + struct HeapAccessor + { + cstatic AuSPtr GetSelfReference(Heap *pHeap) + { + return pHeap->GetSelfReference(); + } + + cstatic Heap *GetSelfReferenceRaw(Heap *pHeap) + { + return pHeap->GetSelfReferenceRaw(); + } + }; + /** Returns a heap interface backed by the default allocator */