48 iCellCount=0; |
48 iCellCount=0; |
49 iTotalAllocSize=0; |
49 iTotalAllocSize=0; |
50 } |
50 } |
51 inline void RAllocator::__DbgMarkCheck(TBool aCountAll, TInt aCount, const TUint8* aFileName, TInt aLineNum) |
51 inline void RAllocator::__DbgMarkCheck(TBool aCountAll, TInt aCount, const TUint8* aFileName, TInt aLineNum) |
52 {__DbgMarkCheck(aCountAll, aCount, TPtrC8(aFileName), aLineNum);} |
52 {__DbgMarkCheck(aCountAll, aCount, TPtrC8(aFileName), aLineNum);} |
53 |
|
54 // Class RHeap |
|
55 inline RHeap::RHeap() |
|
56 {} |
|
57 |
|
58 /** |
|
59 @return The maximum length to which the heap can grow. |
|
60 |
|
61 @publishedAll |
|
62 @released |
|
63 */ |
|
64 inline TInt RHeap::MaxLength() const |
|
65 {return iMaxLength;} |
|
66 |
|
67 inline void RHeap::operator delete(TAny*, TAny*) |
|
68 /** |
|
69 Called if constructor issued by operator new(TUint aSize, TAny* aBase) throws exception. |
|
70 This is dummy as corresponding new operator does not allocate memory. |
|
71 */ |
|
72 {} |
|
73 |
|
74 |
|
75 inline TUint8* RHeap::Base() const |
|
76 /** |
|
77 Gets a pointer to the start of the heap. |
|
78 |
|
79 Note that because of the small space overhead incurred by all allocated cells, |
|
80 no cell will have the same address as that returned by this function. |
|
81 |
|
82 @return A pointer to the base of the heap. |
|
83 */ |
|
84 {return iBase;} |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 inline TInt RHeap::Size() const |
|
90 /** |
|
91 Gets the current size of the heap. |
|
92 |
|
93 This is the total number of bytes committed by the host chunk. |
|
94 It is the requested size rounded up by page size minus the size of RHeap object(116 bytes) |
|
95 minus the cell alignment overhead as shown: |
|
96 |
|
97 Size = (Rounded committed size - Size of RHeap - Cell Alignment Overhead). |
|
98 |
|
99 The cell alignment overhead varies between release builds and debug builds. |
|
100 |
|
101 Note that this value is always greater than the total space available across all allocated cells. |
|
102 |
|
103 @return The size of the heap. |
|
104 |
|
105 @see Rheap::Available( ) |
|
106 */ |
|
107 {return iTop-iBase;} |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 inline TInt RHeap::Align(TInt a) const |
|
113 /** |
|
114 @internalComponent |
|
115 */ |
|
116 {return _ALIGN_UP(a, iAlign);} |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 inline const TAny* RHeap::Align(const TAny* a) const |
|
122 /** |
|
123 @internalComponent |
|
124 */ |
|
125 {return (const TAny*)_ALIGN_UP((TLinAddr)a, iAlign);} |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 inline TBool RHeap::IsLastCell(const SCell* aCell) const |
|
131 /** |
|
132 @internalComponent |
|
133 */ |
|
134 {return (((TUint8*)aCell) + aCell->len) == iTop;} |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 #ifndef __KERNEL_MODE__ |
|
140 inline void RHeap::Lock() const |
|
141 /** |
|
142 @internalComponent |
|
143 */ |
|
144 {((RFastLock&)iLock).Wait();} |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 inline void RHeap::Unlock() const |
|
150 /** |
|
151 @internalComponent |
|
152 */ |
|
153 {((RFastLock&)iLock).Signal();} |
|
154 |
|
155 |
|
156 inline TInt RHeap::ChunkHandle() const |
|
157 /** |
|
158 @internalComponent |
|
159 */ |
|
160 { |
|
161 return iChunkHandle; |
|
162 } |
|
163 #endif |
|
164 |
|
165 |
|
166 |
|
167 |
53 |
168 // Class TRefByValue |
54 // Class TRefByValue |
169 template <class T> |
55 template <class T> |
170 inline TRefByValue<T>::TRefByValue(T &aRef) |
56 inline TRefByValue<T>::TRefByValue(T &aRef) |
171 : iRef(aRef) |
57 : iRef(aRef) |