mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 01:35:43 +00:00
[NTOSKRNL]
Move calculation of commit charge to MiInsertVadEx. svn path=/trunk/; revision=64594
This commit is contained in:
parent
f48ae0dc23
commit
5e034d0a59
2 changed files with 9 additions and 1 deletions
|
@ -291,6 +291,15 @@ MiInsertVadEx(
|
|||
Vad->StartingVpn = StartingAddress >> PAGE_SHIFT;
|
||||
Vad->EndingVpn = EndingAddress >> PAGE_SHIFT;
|
||||
|
||||
/* Check if we already need to charge for the pages */
|
||||
if ((Vad->u.VadFlags.PrivateMemory && Vad->u.VadFlags.MemCommit) ||
|
||||
(!Vad->u.VadFlags.PrivateMemory &&
|
||||
(Vad->u.VadFlags.Protection & PAGE_WRITECOPY)))
|
||||
{
|
||||
/* Set the commit charge */
|
||||
Vad->u.VadFlags.CommitCharge = ViewSize / PAGE_SIZE;
|
||||
}
|
||||
|
||||
/* Check if the VAD is to be secured */
|
||||
if (Vad->u2.VadFlags2.OneSecured)
|
||||
{
|
||||
|
|
|
@ -4589,7 +4589,6 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
|||
if (AllocationType & MEM_COMMIT) Vad->u.VadFlags.MemCommit = 1;
|
||||
Vad->u.VadFlags.Protection = ProtectionMask;
|
||||
Vad->u.VadFlags.PrivateMemory = 1;
|
||||
Vad->u.VadFlags.CommitCharge = AllocationType & MEM_COMMIT ? PageCount : 0;
|
||||
Vad->ControlArea = NULL; // For Memory-Area hack
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue