430 @post MmuLock left unchanged. |
430 @post MmuLock left unchanged. |
431 */ |
431 */ |
432 void RemovePage(SPageInfo* aPageInfo); |
432 void RemovePage(SPageInfo* aPageInfo); |
433 |
433 |
434 /** |
434 /** |
435 Attempt to steal the oldest page on the live list. |
435 Get a page, either by stealing one from the live list or allocating one from the system. |
436 |
436 |
437 If the oldest page is an oldest dirty page, this attempts to clean multiple pages by calling |
437 |
438 #CleanSomePages and then returns without stealing any page. This allows the caller to restart |
438 |
439 their operation after the lengthy cleaning process, which may no longer need to call this |
439 If the oldest page is an oldest dirty page, this may attempt to clean multiple pages by calling |
440 function. |
440 #CleanSomePages. |
441 |
441 |
442 If the oldest page is on any other list (i.e. is an old or young page) this will steal it, |
442 If the oldest page is on any other list (i.e. is an old or young page) this will steal it, |
443 aquiring the page cleaning mutex first if it is dirty. |
443 aquiring the page cleaning mutex first if it is dirty. |
444 |
444 |
445 Called from #PageInAllocPage. |
445 Called from #PageInAllocPage and #TryReturnOldestPageToSystem. |
446 |
446 |
447 @param aPageInfoOut Set to the SPageInfo pointer for the stolen page if any. |
447 @param aAllowAlloc Indicates whether the method should try to allocate a page from the system |
448 |
448 |
449 @return KErrNone on success, KErrInUse if stealing failed or 1 to indicate the the oldest page |
449 @return KErrNone on success, KErrInUse if stealing failed or 1 to indicate the the oldest page |
450 was dirty and the PageCleaning mutex was not held. |
450 was dirty and the PageCleaning mutex was not held. |
451 |
451 |
452 @pre MmuLock held |
452 @pre MmuLock held |
453 @post MmuLock left unchanged. |
453 @post MmuLock left unchanged. |
454 */ |
454 */ |
455 TInt TryStealOldestPage(SPageInfo*& aPageInfoOut); |
455 SPageInfo* StealOrAllocPage(TBool aAllowAlloc, Mmu::TRamAllocFlags aAllocFlags); |
456 |
456 |
457 /** |
457 /** |
458 Steal a page from the memory object (if any) which is using the page. |
458 Steal a page from the memory object (if any) which is using the page. |
459 If successful the returned page will be in the EUnknown state and the |
459 If successful the returned page will be in the EUnknown state and the |
460 cache state for the page is indeterminate. This is the same state as |
460 cache state for the page is indeterminate. This is the same state as |