[+] MemoryView::DemoteFromSharedView

This commit is contained in:
Reece Wilson 2024-05-21 11:30:15 +01:00
parent 30b89f1bd7
commit 60771f6e6b

View File

@ -435,6 +435,24 @@ namespace Aurora::Memory
return false;
}
}
void DemoteFromSharedView(const AuSPtr<MemoryView> &pCopy)
{
if (!pCopy)
{
AuResetMember(*this);
return;
}
if (pCopy->HasControlBlock())
{
AuResetMember(*this, AuConstReference(*pCopy.get()));
}
else
{
AuResetMember(*this, AuConstReference(*pCopy.get()), pCopy);
}
}
};
using MemoryViewRead = MemoryView<true>;