Windows: Fixes SHM stats reallocation

This was accidentally setting `CurrentSize` instead of just returning
the newly allocated size to the frontend. This was causing the frontend
to then fail to detect the reallocation actually occured and no longer
get stats for new threads.

Also happened to not use `NewSize` but instead `CurrentSize * 2` which
didn't matter as it matched the growth pattern, but was technically
incorrect.

Fixes SHM stats since the introduction of the unixlib, ezpz.
This commit is contained in:
Ryan Houdek committed 2026-07-02 13:38:14 -07:00
1 parent 1db45e2a70
commit 812b6398e5
1 file changed
+3 -6
+3 -6
View File
@@ -19,13 +19,10 @@ uint32_t StatAlloc::FrontendAllocateSlots(uint32_t NewSize) {
return CurrentSize;
}
auto Result = UnixLib::AllocateSHMSlots(Base, std::min(CurrentSize * 2, MAX_STATS_SIZE), MAX_STATS_SIZE);
auto Result = UnixLib::AllocateSHMSlots(Base, std::min(NewSize, MAX_STATS_SIZE), MAX_STATS_SIZE);
if (Result.SHMBase) {
CurrentSize = Result.MappedSize;
}
return CurrentSize;
// Return the new size allocated, if it happened to change.
return Result.MappedSize;
}
StatAlloc::StatAlloc(FEXCore::SHMStats::AppType AppType) {