diff --git a/Source/Interface/Core/BlockCache.cpp b/Source/Interface/Core/BlockCache.cpp index ce79c66a8..c665892e6 100644 --- a/Source/Interface/Core/BlockCache.cpp +++ b/Source/Interface/Core/BlockCache.cpp @@ -21,7 +21,7 @@ BlockCache::BlockCache(FEXCore::Context::Context *CTX) // At 64GB of virtual memory this will allocate 128MB of virtual memory space PagePointer = reinterpret_cast(mmap(nullptr, ctx->Config.VirtualMemSize / 4096 * 8, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)); - // Allocate our memory backing our pageso + // Allocate our memory backing our pages // We need 32KB per guest page (One pointer per byte) // XXX: We can drop down to 16KB if we store 4byte offsets from the code base // We currently limit to 128MB of real memory for caching for the total cache size. diff --git a/Source/Interface/Core/BlockCache.h b/Source/Interface/Core/BlockCache.h index 162f5281a..6992d6425 100644 --- a/Source/Interface/Core/BlockCache.h +++ b/Source/Interface/Core/BlockCache.h @@ -21,14 +21,14 @@ public: Address >>= 12; uintptr_t *Pointers = reinterpret_cast(PagePointer); - uint64_t PagePointer = Pointers[Address]; - if (!PagePointer) { + uint64_t LocalPagePointer = Pointers[Address]; + if (!LocalPagePointer) { // Page for this code didn't even exist, nothing to do return; } // Page exists, just set the offset to zero - uintptr_t *BlockPointers = reinterpret_cast(PagePointer); + uintptr_t *BlockPointers = reinterpret_cast(LocalPagePointer); BlockPointers[PageOffset] = 0; } @@ -61,6 +61,8 @@ public: void HintUsedRange(uint64_t Address, uint64_t Size); + uintptr_t GetPagePointer() { return PagePointer; } + private: uintptr_t AllocateBackingForPage() { uintptr_t NewBase = AllocateOffset;