MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / FrontendAllocateSlots

Method FrontendAllocateSlots

Source/Windows/Common/SHMStats.cpp:23–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23uint32_t StatAlloc::FrontendAllocateSlots(uint32_t NewSize) {
24 if (CurrentSize == MAX_STATS_SIZE || !UsingNTQueryPath) {
25 LogMan::Msg::DFmt("Ran out of slots. Can't allocate more");
26 return CurrentSize;
27 }
28
29 MEMORY_FEX_STATS_SHM_INFORMATION Info {
30 .shm_base = nullptr,
31 .map_size = std::min(CurrentSize * 2, MAX_STATS_SIZE),
32 .max_size = MAX_STATS_SIZE,
33 };
34 size_t Length {};
35 auto Result = NtQueryVirtualMemory(NtCurrentProcess(), nullptr, MemoryFexStatsShm, &Info, sizeof(Info), &Length);
36 if (!Result) {
37 CurrentSize = Info.map_size;
38 }
39
40 return CurrentSize;
41}
42
43StatAlloc::StatAlloc(FEXCore::SHMStats::AppType AppType) {
44 // Try wine+fex magic path.

Callers

nothing calls this directly

Calls 1

DFmtFunction · 0.85

Tested by

no test coverage detected