[NTOSKRNL/MM]

- Actually, there is no need to crawl the entire tree, just going past the limit is enough. Thanks Timo.
- Fix MSVC warning, thanks Ged.
Now you have correct AND optimized code, Alex AND Timo should be happy.
I'm only the committer of these fix, the work was mostly done by Thomas Faber and Alex Ionescu.

svn path=/trunk/; revision=53064
This commit is contained in:
Jérôme Gardou 2011-08-04 18:23:20 +00:00
parent 20087fcf26
commit e2c053a307

View file

@ -393,10 +393,11 @@ MiFindEmptyAddressRangeDownTree(IN SIZE_T Length,
/* Calculate the initial upper margin */
HighVpn = BoundaryAddress >> PAGE_SHIFT;
/* Starting from the root, go down until the right-most child,
trying to stay below the boundary. */
/* Starting from the root, go down until the right-most child
* which is just behind the boundary*/
LowestNode = Node = RtlRightChildAvl(&Table->BalancedRoot);
while ((Child = RtlRightChildAvl(Node))) Node = Child;
while (((Child = RtlRightChildAvl(Node)) != 0 )
&& (Node->EndingVpn < HighVpn )) Node = Child;
/* Now loop the Vad nodes */
while (Node)