From 2229c04d4de6be73e22357bbd36be69ddcbf79fa Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sat, 1 Nov 2025 15:11:44 -0700 Subject: [PATCH] LookupCache: Fixes assert These two asserts could never fail, Add assert to the base allocation instead. --- FEXCore/Source/Interface/Core/LookupCache.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/FEXCore/Source/Interface/Core/LookupCache.cpp b/FEXCore/Source/Interface/Core/LookupCache.cpp index 1c52a93b5..2623e7075 100644 --- a/FEXCore/Source/Interface/Core/LookupCache.cpp +++ b/FEXCore/Source/Interface/Core/LookupCache.cpp @@ -39,6 +39,8 @@ LookupCache::LookupCache(FEXCore::Context::ContextImpl* CTX) // We need one pointer per page of virtual memory // At 64GB of virtual memory this will allocate 128MB of virtual memory space PagePointer = reinterpret_cast(FEXCore::Allocator::VirtualAlloc(TotalCacheSize, false, false)); + LOGMAN_THROW_A_FMT(PagePointer != -1ULL, "Failed to allocate PagePointer"); + FEXCore::Allocator::VirtualName("FEXMem_Lookup", reinterpret_cast(PagePointer), ctx->Config.VirtualMemSize / FEXCore::Utils::FEX_PAGE_SIZE * 8 + CODE_SIZE); CTX->SyscallHandler->MarkOvercommitRange(PagePointer, TotalCacheSize); @@ -49,14 +51,11 @@ LookupCache::LookupCache(FEXCore::Context::ContextImpl* CTX) // We currently limit to 128MB of real memory for caching for the total cache size. // Can end up being inefficient if we compile a small number of blocks per page PageMemory = PagePointer + ctx->Config.VirtualMemSize / FEXCore::Utils::FEX_PAGE_SIZE * 8; - LOGMAN_THROW_A_FMT(PageMemory != -1ULL, "Failed to allocate page memory"); // L1 Cache L1Pointer = PageMemory + CODE_SIZE; FEXCore::Allocator::VirtualName("FEXMem_Lookup_L1", reinterpret_cast(L1Pointer), MAX_L1_SIZE); - LOGMAN_THROW_A_FMT(L1Pointer != -1ULL, "Failed to allocate L1Pointer"); - VirtualMemSize = ctx->Config.VirtualMemSize; if (DynamicL1Cache()) {