0
|
1 |
// Copyright (c) 2005-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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// e32\include\kernel\kbma.h
|
|
15 |
//
|
|
16 |
// WARNING: This file contains some APIs which are internal and are subject
|
|
17 |
// to change without notice. Such APIs should therefore not be used
|
|
18 |
// outside the Kernel and Hardware Services package.
|
|
19 |
//
|
|
20 |
|
|
21 |
#ifndef __KBMA_H__
|
|
22 |
#define __KBMA_H__
|
|
23 |
|
|
24 |
#include <e32cmn.h>
|
|
25 |
|
|
26 |
/** Simple bitmap allocator
|
|
27 |
|
|
28 |
@publishedPartner
|
|
29 |
@released
|
|
30 |
*/
|
|
31 |
class TBitMapAllocator
|
|
32 |
{
|
|
33 |
public:
|
|
34 |
IMPORT_C static TBitMapAllocator* New(TInt aSize, TBool aState);
|
|
35 |
IMPORT_C TBitMapAllocator(TInt aSize, TBool aState);
|
|
36 |
inline TInt Avail() const {return iAvail;}
|
|
37 |
IMPORT_C TInt Alloc();
|
|
38 |
IMPORT_C TInt AllocFrom(TUint aOffset);
|
|
39 |
IMPORT_C void Free(TInt aPos);
|
|
40 |
IMPORT_C void Alloc(TInt aStart, TInt aLength);
|
|
41 |
IMPORT_C void Free(TInt aStart, TInt aLength);
|
|
42 |
IMPORT_C void SelectiveFree(TInt aStart, TInt aLength);
|
|
43 |
IMPORT_C TBool NotFree(TInt aStart, TInt aLength) const;
|
|
44 |
IMPORT_C TBool NotAllocated(TInt aStart, TInt aLength) const;
|
|
45 |
IMPORT_C TInt AllocList(TInt aLength, TInt* aList);
|
|
46 |
IMPORT_C TInt AllocConsecutive(TInt aLength, TBool aBestFit) const;
|
|
47 |
IMPORT_C TInt AllocAligned(TInt aLength, TInt aAlign, TInt aBase, TBool aBestFit) const;
|
|
48 |
IMPORT_C TInt AllocAligned(TInt aLength, TInt aAlign, TInt aBase, TBool aBestFit, TInt& aCarry, TInt& aRunLength) const;
|
|
49 |
IMPORT_C TInt AllocAligned(TInt aLength, TInt aAlign, TInt aBase, TBool aBestFit, TInt& aCarry, TInt& aRunLength, TUint aOffset) const;
|
|
50 |
IMPORT_C void CopyAlignedRange(const TBitMapAllocator* aA, TInt aFirst, TInt aLen);
|
|
51 |
public:
|
|
52 |
TInt iAvail; /**< @internalComponent */
|
|
53 |
TUint32* iCheckFirst; /**< @internalComponent */
|
|
54 |
TInt iSize; /**< @internalComponent */
|
|
55 |
TUint32 iMap[1]; /**< @internalComponent */ // extend
|
|
56 |
};
|
|
57 |
|
|
58 |
#endif
|