mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-08 03:00:35 +02:00
FEXCore/SharedCodeBufferManager: Pivot what tracks memory allocations
It's soon going to change how these buffers are managed, where the CodeBuffer is going to manage its own allocations soon once it changes over to the bitmap allocator. Additionally the Manager class is actually going to do proper management, pooling, and invalidation handling. Split the task preemptively before we switch to the bitmap allocator to reduce churn. A little change in the CodeCache where it needs to query the codebuffer directly rather than the context, but fairly safe. Shouldn't be any real behaviour change.
This commit is contained in:
5 files changed
+45
-43
No files matched your search
@@ -34,6 +34,9 @@ CodeBuffer::CodeBuffer(size_t Size)
|
||||
FEXCore::Allocator::VirtualTHPControl(Ptr, Size, FEXCore::Allocator::THPControl::Enable);
|
||||
|
||||
LookupCache = fextl::make_unique<GuestToHostMap>();
|
||||
|
||||
CodeBufferEnd = Ptr + UsableSize();
|
||||
CodeBufferOffset = Ptr;
|
||||
}
|
||||
|
||||
CodeBuffer::~CodeBuffer() {
|
||||
@@ -66,9 +69,6 @@ fextl::shared_ptr<CodeBuffer> SharedCodeBufferManager::AllocateNew(size_t Size)
|
||||
auto Buffer = fextl::make_shared<CodeBuffer>(Size);
|
||||
|
||||
Latest = Buffer;
|
||||
CodeBufferBase = Buffer->Ptr;
|
||||
CodeBufferEnd = Buffer->Ptr + Buffer->UsableSize();
|
||||
CodeBufferOffset = CodeBufferBase;
|
||||
|
||||
OnCodeBufferAllocated(Buffer);
|
||||
|
||||
|
||||
Reference in new issue
Block a user