mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[NTOSKRNL]
Small impovement to NtFreeVirtualMemory to make things clearer svn path=/trunk/; revision=64585
This commit is contained in:
parent
27b5c44ea3
commit
ca00c95ea5
1 changed files with 7 additions and 5 deletions
|
@ -5134,7 +5134,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle,
|
|||
PMEMORY_AREA MemoryArea;
|
||||
SIZE_T PRegionSize;
|
||||
PVOID PBaseAddress;
|
||||
LONG_PTR CommitReduction = 0;
|
||||
LONG_PTR AlreadyDecommitted, CommitReduction = 0;
|
||||
ULONG_PTR StartingAddress, EndingAddress;
|
||||
PMMVAD Vad;
|
||||
NTSTATUS Status;
|
||||
|
@ -5530,13 +5530,15 @@ FinalPath:
|
|||
// Decommit the PTEs for the range plus the actual backing pages for the
|
||||
// range, then reduce that amount from the commit charge in the VAD
|
||||
//
|
||||
AlreadyDecommitted = MiDecommitPages((PVOID)StartingAddress,
|
||||
MiAddressToPte(EndingAddress),
|
||||
Process,
|
||||
Vad);
|
||||
CommitReduction = MiAddressToPte(EndingAddress) -
|
||||
MiAddressToPte(StartingAddress) +
|
||||
1 -
|
||||
MiDecommitPages((PVOID)StartingAddress,
|
||||
MiAddressToPte(EndingAddress),
|
||||
Process,
|
||||
Vad);
|
||||
AlreadyDecommitted;
|
||||
|
||||
ASSERT(CommitReduction >= 0);
|
||||
Vad->u.VadFlags.CommitCharge -= CommitReduction;
|
||||
ASSERT(Vad->u.VadFlags.CommitCharge >= 0);
|
||||
|
|
Loading…
Reference in a new issue