* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: rmap.c,v 1.30 2004/08/15 16:39:08 chorns Exp $
+/* $Id: rmap.c,v 1.31 2004/10/02 10:16:10 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel
{
PMM_RMAP_ENTRY current_entry;
PMM_RMAP_ENTRY new_entry;
+ ULONG PrevSize;
Address = (PVOID)PAGE_ROUND_DOWN(Address);
new_entry->Next = current_entry;
MmSetRmapListHeadPage(Page, new_entry);
ExReleaseFastMutex(&RmapListLock);
+ if (Process == NULL)
+ {
+ Process = PsInitialSystemProcess;
+ }
+ if (Process)
+ {
+ PrevSize = InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, PAGE_SIZE);
+ if (PrevSize >= Process->Vm.PeakWorkingSetSize)
+ {
+ Process->Vm.PeakWorkingSetSize = PrevSize + PAGE_SIZE;
+ }
+ }
}
VOID
{
PMM_RMAP_ENTRY current_entry;
PMM_RMAP_ENTRY previous_entry;
+ PEPROCESS Process;
ExAcquireFastMutex(&RmapListLock);
current_entry = MmGetRmapListHeadPage(Page);
DeleteMapping(Context, previous_entry->Process,
previous_entry->Address);
}
+ Process = previous_entry->Process;
ExFreeToNPagedLookasideList(&RmapLookasideList, previous_entry);
+ if (Process == NULL)
+ {
+ Process = PsInitialSystemProcess;
+ }
+ if (Process)
+ {
+ InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
+ }
}
ExReleaseFastMutex(&RmapListLock);
}
}
ExReleaseFastMutex(&RmapListLock);
ExFreeToNPagedLookasideList(&RmapLookasideList, current_entry);
+ if (Process == NULL)
+ {
+ Process = PsInitialSystemProcess;
+ }
+ if (Process)
+ {
+ InterlockedExchangeAdd(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
+ }
return;
}
previous_entry = current_entry;