kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp
changeset 201 43365a9b78a3
parent 109 b3a1d9898418
child 259 57b9594f5772
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Wed Jun 23 19:44:53 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Tue Jul 06 15:50:07 2010 +0300
@@ -576,7 +576,7 @@
 				__NK_ASSERT_ALWAYS(romPageInfo->iPagingAttributes & SRomPageInfo::EPageable);
 
 				// Read data for page...
-				const TLinAddr buffer = aRequest->iBuffer;
+				const TLinAddr buffer = aRequest->Buffer();
 				const TUint readStart = dataOffset >> readUnitShift;
 				const TUint readSize = ((dataOffset + dataSize - 1) >> readUnitShift) - readStart + 1;
 				__NK_ASSERT_DEBUG((readSize << readUnitShift) <= (DPageReadRequest::EMaxPages << KPageShift));
@@ -958,7 +958,11 @@
 	RamAllocLock::Lock();
 
 	Mmu& m = TheMmu;
-	r = m.AllocRam(&iNewPage, 1, aMemory->RamAllocFlags(), EPageFixed);
+	// Allocate a page to shadow to allowing the allocation to steal pages from the paging cache.
+	r = m.AllocRam(	&iNewPage, 
+					1, 
+					(Mmu::TRamAllocFlags)(aMemory->RamAllocFlags() & ~Mmu::EAllocNoPagerReclaim), 
+					EPageFixed);
 	if(r==KErrNone)
 		{
 		TLinAddr dst = m.MapTemp(iNewPage,aIndex,0);