diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2011-07-07 14:47:20 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2011-07-07 14:47:20 -0400 |
commit | 774306bc25b4b737d318bdd28ab0b078dc60db74 (patch) | |
tree | fb503b25a883090ba6d3b15c37e8142672e91881 /indra/llcommon | |
parent | 65657b9f5cf04b5a84e566b7491daabb1291ace9 (diff) |
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.
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llsys.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 68566cdbfa..b3ab5008fb 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -915,7 +915,13 @@ LLSD LLMemoryInfo::loadStatsArray() PROCESS_MEMORY_COUNTERS_EX 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("PeakWorkingSetSize KB", pmem.PeakWorkingSetSize/1024); |