First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\include\memmodel\epoc\mmubase\defrag.h
21 /******************************************************************************
22 * Base class for RAM defragmentation implementation
23 ******************************************************************************/
40 // platform independent - defragbase.cpp
42 void Init3(DRamAllocator* aRamAllocator);
43 static void DefragTask(TAny* aArg);
45 TInt GeneralDefrag(TRamDefragRequest* aRequest);
46 TInt ClaimRamZone(TRamDefragRequest* aRequest);
47 TInt EmptyRamZone(TRamDefragRequest* aRequest);
48 TInt ClearZone(SZone& aZone, TUint aMaxRetries, TRamDefragRequest* aRequest);
49 TInt ClearMovableFromZone(SZone& aZone, TBool aBestEffort, TRamDefragRequest* aRequest);
50 TInt ClearDiscardableFromZone(SZone& aZone, TBool aBestEffort, TRamDefragRequest* aRequest, TUint* aMaxDiscard=NULL);
51 static void Panic(TPanic aPanic);
58 DRamAllocator* iRamAllocator;
60 static Defrag* TheDefrag; // single instance of the defragmentor
62 friend class TRamDefragRequest; // This needs access to iDefragPriority and iTaskQ