[+] AuMemory::HeapAccessor

This commit is contained in:
Reece Wilson 2024-01-27 08:04:29 +00:00
parent 2b69c07b67
commit fc081615a7

View File

@ -377,6 +377,7 @@ namespace Aurora::Memory
protected:
friend struct ProxyHeap;
friend struct HeapAccessor;
virtual AuSPtr<Heap> 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<Heap> GetSelfReference(Heap *pHeap)
{
return pHeap->GetSelfReference();
}
cstatic Heap *GetSelfReferenceRaw(Heap *pHeap)
{
return pHeap->GetSelfReferenceRaw();
}
};
/**
Returns a heap interface backed by the default allocator
*/