From e5743f8daeff82333b5f0ee458e3e5aec2e06c8a Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Tue, 11 Nov 2025 09:23:40 +0100 Subject: [PATCH] Use gradual memory growth Use min instead of max, otherwise we are always using `MAX_STATS_SIZE`. --- Source/Tools/LinuxEmulation/LinuxSyscalls/ThreadManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/ThreadManager.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/ThreadManager.cpp index b1c8429bf..59dbd5c1e 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/ThreadManager.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/ThreadManager.cpp @@ -76,7 +76,7 @@ uint32_t ThreadManager::StatAlloc::FrontendAllocateSlots(uint32_t NewSize) { // New threads won't get stats. return CurrentSize; } - NewSize = std::max(MAX_STATS_SIZE, NewSize); + NewSize = std::min(MAX_STATS_SIZE, NewSize); // When allocating more slots, open the fd without O_TRUNC | O_CREAT. int fd = shm_open(fextl::fmt::format("fex-{}-stats", ::getpid()).c_str(), O_RDWR, USER_PERMS);