FEXCore: Fixes ever shrinking JIT code buffer

I accidentally replaced a couple usages of `AllocatedSize` with
`GetAllocatedSize()`. This resulted in a JIT buffer that ran out of
space would actually allocate a slightly smaller buffer each time, and
then it cascades downwards resulting in catastrophic performance.

Fix the use in `SharedCodeBufferManager.cpp` and `Core.cpp` which were
incorrect and renames the function to be more explicit.
This commit is contained in:
Ryan Houdek committed 2026-08-22 18:31:22 -07:00
1 parent b563703701
commit db3817a260
4 files changed
+13 -8

No files matched your search

@@ -88,7 +88,7 @@ fextl::shared_ptr<CodeBuffer> SharedCodeBufferManager::StartLargerCodeBuffer() {
return GetLatest();
}
auto NewCodeBufferSize = GetLatest()->GetAllocatedSize();
auto NewCodeBufferSize = GetLatest()->TotalAllocationSize();
NewCodeBufferSize = std::min<size_t>(NewCodeBufferSize * 2, MAX_CODE_SIZE);
return AllocateNew(NewCodeBufferSize);
}