diff -r 2bb754abd467 -r 0ffb4e86fcc9 kernel/eka/memmodel/epoc/flexible/mmu/mptalloc.cpp --- a/kernel/eka/memmodel/epoc/flexible/mmu/mptalloc.cpp Mon Jun 21 17:12:14 2010 +0300 +++ b/kernel/eka/memmodel/epoc/flexible/mmu/mptalloc.cpp Thu Jul 15 20:11:42 2010 +0300 @@ -184,6 +184,7 @@ } #endif } + RamAllocLock::Unlock(); TUint usedNew = 0; if(r==KErrNone) @@ -198,15 +199,9 @@ MmuLock::Unlock(); usedNew = 1; - // Must hold the ram alloc lock until the page has been set as managed - // otherwise it will still be seen as free by the rest of the system. - RamAllocLock::Unlock(); - // map page... r = aMemory->MapPages(pageList); } - else - RamAllocLock::Unlock(); // release page array entry... aMemory->iPages.AddPageEnd(aIndex,usedNew); @@ -1193,9 +1188,9 @@ TInt PageTableAllocator::MovePage(DMemoryObject* aMemory, SPageInfo* aOldPageInfo, TUint aBlockZoneId, TBool aBlockRest) { + __NK_ASSERT_DEBUG(MmuLock::IsHeld()); // We don't move page table or page table info pages, however, if this page // is demand paged then we may be able to discard it. - MmuLock::Lock(); if (aOldPageInfo->Owner() == iPageTableInfoMemory) { if (!(iPtPageAllocator.IsDemandPagedPtInfo(aOldPageInfo)))