|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __FASTALLOCATOR_H__ |
|
19 #define __FASTALLOCATOR_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32cmn.h> |
|
23 |
|
24 class CFastMemoryPool; |
|
25 |
|
26 class RFastAllocator : public RAllocator |
|
27 { |
|
28 public: |
|
29 IMPORT_C RFastAllocator(CFastMemoryPool*); |
|
30 IMPORT_C ~RFastAllocator(); |
|
31 |
|
32 IMPORT_C TAny* Alloc(TInt aSize); |
|
33 IMPORT_C void Free(TAny* aPtr); |
|
34 IMPORT_C TAny* ReAlloc(TAny* aPtr, TInt aSize, TInt aMode=0); |
|
35 IMPORT_C TInt AllocLen(const TAny* aCell) const; |
|
36 IMPORT_C TInt Compress(); |
|
37 IMPORT_C void Reset(); |
|
38 IMPORT_C TInt AllocSize(TInt& aTotalAllocSize) const; |
|
39 IMPORT_C TInt Available(TInt& aBiggestBlock) const; |
|
40 IMPORT_C TInt DebugFunction(TInt aFunc, TAny* a1=NULL, TAny* a2=NULL); |
|
41 IMPORT_C TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); |
|
42 |
|
43 private: |
|
44 TBool IsLocatedInHeap( TAny* aPtr ) const; |
|
45 |
|
46 RHeap& iHeap; |
|
47 TUint32 iHeapBase; |
|
48 CFastMemoryPool* iPool; |
|
49 }; |
|
50 |
|
51 #endif //!__FASTALLOCATOR_H__ |