Author: tkreuzer
Date: Wed Oct 8 00:32:03 2014
New Revision: 64594
URL:
http://svn.reactos.org/svn/reactos?rev=64594&view=rev
Log:
[NTOSKRNL]
Move calculation of commit charge to MiInsertVadEx.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c
trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c [iso-8859-1] Wed Oct 8 00:32:03 2014
@@ -291,6 +291,15 @@
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)
{
Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Wed Oct 8 00:32:03 2014
@@ -4589,7 +4589,6 @@
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
//