equal
deleted
inserted
replaced
18 #ifndef __FASTALLOCATOR_H__ |
18 #ifndef __FASTALLOCATOR_H__ |
19 #define __FASTALLOCATOR_H__ |
19 #define __FASTALLOCATOR_H__ |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <e32cmn.h> |
22 #include <e32cmn.h> |
|
23 |
|
24 #ifdef TRACK_ALLOCATIONS |
|
25 typedef struct { |
|
26 TInt requestedSize; |
|
27 TUint32 cellId; |
|
28 }THeapTrace; |
|
29 |
|
30 TAny* GetRealPtrFromClientPtr(TAny* aClientPtr); |
|
31 void DecreaseSizeInPlace(TInt& aSize); |
|
32 |
|
33 class CMemoryPool; |
|
34 TAny* TraceAlloc(CMemoryPool* aPool, TInt* aSize, TUint32* aCellId); |
|
35 void TraceFree(TAny **aPtr); |
|
36 TBool TracePreRealloc(TAny** aPtr, TInt *aSize, TUint32& aOriginalCellId); |
|
37 void TracePostRealloc(TAny** p, TInt aRequestedSize, TUint32* aNewCellId, TUint32 aOriginalCellId, TBool aIssueNewCellId); |
|
38 |
|
39 #endif |
23 |
40 |
24 class CFastMemoryPool; |
41 class CFastMemoryPool; |
25 |
42 |
26 class RFastAllocator : public RAllocator |
43 class RFastAllocator : public RAllocator |
27 { |
44 { |
44 TBool IsLocatedInHeap( TAny* aPtr ) const; |
61 TBool IsLocatedInHeap( TAny* aPtr ) const; |
45 |
62 |
46 RHeap& iHeap; |
63 RHeap& iHeap; |
47 TUint32 iHeapBase; |
64 TUint32 iHeapBase; |
48 CFastMemoryPool* iPool; |
65 CFastMemoryPool* iPool; |
|
66 #ifdef TRACK_ALLOCATIONS |
|
67 TUint32 iNextCellId; |
|
68 #endif |
|
69 }; |
|
70 |
|
71 class CNewSymbianHeapPool; |
|
72 |
|
73 NONSHARABLE_CLASS(RSymbianDlAllocatorWrapper) : public RAllocator |
|
74 { |
|
75 public: |
|
76 RSymbianDlAllocatorWrapper(CNewSymbianHeapPool*); |
|
77 ~RSymbianDlAllocatorWrapper(); |
|
78 |
|
79 TAny* Alloc(TInt aSize); |
|
80 void Free(TAny* aPtr); |
|
81 TAny* ReAlloc(TAny* aPtr, TInt aSize, TInt aMode=0); |
|
82 TInt AllocLen(const TAny* aCell) const; |
|
83 TInt Compress(); |
|
84 void Reset(); |
|
85 TInt AllocSize(TInt& aTotalAllocSize) const; |
|
86 TInt Available(TInt& aBiggestBlock) const; |
|
87 TInt DebugFunction(TInt aFunc, TAny* a1=NULL, TAny* a2=NULL); |
|
88 TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); |
|
89 |
|
90 private: |
|
91 CNewSymbianHeapPool* iPool; |
|
92 #ifdef TRACK_ALLOCATIONS |
|
93 TUint32 iNextCellId; |
|
94 #endif |
49 }; |
95 }; |
50 |
96 |
51 #endif //!__FASTALLOCATOR_H__ |
97 #endif //!__FASTALLOCATOR_H__ |