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

@@ -71,8 +71,13 @@ struct CodeBuffer {
return AllocatedSize - FEXCore::Utils::FEX_PAGE_SIZE;
}
// Returns the full size of the buffer, including the guard page.
size_t TotalAllocationSize() const {
return AllocatedSize;
}
// Returns the num of bytes currently allocated from the allocator.
size_t GetAllocatedSize() const {
size_t AllocatedSpaceUsed() const {
return CodeBufferOffset - Ptr;
}