Skip to content
Snippets Groups Projects
Commit 774306bc authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

CHOP-753: have to cast pointer passed to GetProcessMemoryInfo().

GetProcessMemoryInfo() is prototyped with PROCESS_MEMORY_COUNTERS*, so to
accept PROCESS_MEMORY_COUNTERS_EX* as documented, have to cast.
parent 65657b9f
No related branches found
No related tags found
No related merge requests found
...@@ -915,7 +915,13 @@ LLSD LLMemoryInfo::loadStatsArray() ...@@ -915,7 +915,13 @@ LLSD LLMemoryInfo::loadStatsArray()
PROCESS_MEMORY_COUNTERS_EX pmem; PROCESS_MEMORY_COUNTERS_EX pmem;
pmem.cb = sizeof(pmem); pmem.cb = sizeof(pmem);
GetProcessMemoryInfo(GetCurrentProcess(), &pmem, sizeof(pmem)); // GetProcessMemoryInfo() is documented to accept either
// PROCESS_MEMORY_COUNTERS* or PROCESS_MEMORY_COUNTERS_EX*, presumably
// using the redundant size info to distinguish. But its prototype
// specifically accepts PROCESS_MEMORY_COUNTERS*, and since this is a
// classic-C API, PROCESS_MEMORY_COUNTERS_EX isn't a subclass. Cast the
// pointer.
GetProcessMemoryInfo(GetCurrentProcess(), PPROCESS_MEMORY_COUNTERS(&pmem), sizeof(pmem));
stats.add("Page Fault Count", pmem.PageFaultCount); stats.add("Page Fault Count", pmem.PageFaultCount);
stats.add("PeakWorkingSetSize KB", pmem.PeakWorkingSetSize/1024); stats.add("PeakWorkingSetSize KB", pmem.PeakWorkingSetSize/1024);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment