Use gradual memory growth

Use min instead of max, otherwise we are always using `MAX_STATS_SIZE`.
This commit is contained in:
Paulo Matos authored and GitHub committed 2025-11-11 09:23:40 +01:00
1 parent 2febb524e9
commit e5743f8dae
1 file changed
+1 -1
@@ -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);