Commit 032190ac authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

taskmgr: Introduce size_diff helper.

parent ca8de0e9
...@@ -51,6 +51,11 @@ static SYSTEM_CACHE_INFORMATION SystemCacheInfo; ...@@ -51,6 +51,11 @@ static SYSTEM_CACHE_INFORMATION SystemCacheInfo;
static SYSTEM_HANDLE_INFORMATION SystemHandleInfo; static SYSTEM_HANDLE_INFORMATION SystemHandleInfo;
static PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SystemProcessorTimeInfo = NULL; static PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SystemProcessorTimeInfo = NULL;
static size_t size_diff(size_t x, size_t y)
{
return x > y ? x - y : y - x;
}
BOOL PerfDataInitialize(void) BOOL PerfDataInitialize(void)
{ {
LONG status; LONG status;
...@@ -266,12 +271,12 @@ void PerfDataRefresh(void) ...@@ -266,12 +271,12 @@ void PerfDataRefresh(void)
pPerfData[Idx].vmCounters.WorkingSetSize = pSPI->vmCounters.WorkingSetSize; pPerfData[Idx].vmCounters.WorkingSetSize = pSPI->vmCounters.WorkingSetSize;
pPerfData[Idx].vmCounters.PeakWorkingSetSize = pSPI->vmCounters.PeakWorkingSetSize; pPerfData[Idx].vmCounters.PeakWorkingSetSize = pSPI->vmCounters.PeakWorkingSetSize;
if (pPDOld) if (pPDOld)
pPerfData[Idx].WorkingSetSizeDelta = labs(pSPI->vmCounters.WorkingSetSize - pPDOld->vmCounters.WorkingSetSize); pPerfData[Idx].WorkingSetSizeDelta = size_diff(pSPI->vmCounters.WorkingSetSize, pPDOld->vmCounters.WorkingSetSize);
else else
pPerfData[Idx].WorkingSetSizeDelta = 0; pPerfData[Idx].WorkingSetSizeDelta = 0;
pPerfData[Idx].vmCounters.PageFaultCount = pSPI->vmCounters.PageFaultCount; pPerfData[Idx].vmCounters.PageFaultCount = pSPI->vmCounters.PageFaultCount;
if (pPDOld) if (pPDOld)
pPerfData[Idx].PageFaultCountDelta = labs(pSPI->vmCounters.PageFaultCount - pPDOld->vmCounters.PageFaultCount); pPerfData[Idx].PageFaultCountDelta = size_diff(pSPI->vmCounters.PageFaultCount, pPDOld->vmCounters.PageFaultCount);
else else
pPerfData[Idx].PageFaultCountDelta = 0; pPerfData[Idx].PageFaultCountDelta = 0;
pPerfData[Idx].vmCounters.VirtualSize = pSPI->vmCounters.VirtualSize; pPerfData[Idx].vmCounters.VirtualSize = pSPI->vmCounters.VirtualSize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment