168 iTouchedRegionFlag += aSegmentCount; |
168 iTouchedRegionFlag += aSegmentCount; |
169 // __PRINT3(_L("!! USED RESERVED SEGS: addr=0x%x, touched=%d, reserved=%d"), addr, iTouchedRegionFlag, iReservedRegionMarkInSegs); |
169 // __PRINT3(_L("!! USED RESERVED SEGS: addr=0x%x, touched=%d, reserved=%d"), addr, iTouchedRegionFlag, iReservedRegionMarkInSegs); |
170 return addr; |
170 return addr; |
171 } |
171 } |
172 |
172 |
173 // if we have used up reserved region, get new pages from reusable pool first |
173 TBool touchedMore = EFalse; |
|
174 // if we have touched beyond reserved region, get new pages from reusable pool first |
174 if (iReusablePagePool.Count()) |
175 if (iReusablePagePool.Count()) |
175 { |
176 { |
176 addr = iReusablePagePool[0]; |
177 addr = iReusablePagePool[0]; |
177 iReusablePagePool.Remove(0); |
178 iReusablePagePool.Remove(0); |
178 // __PRINT2(_L("!! USED REUSABLE POOL SEGS: addr=0x%x, reusable.Count()=%d"), addr, iReusablePagePool.Count()); |
179 // __PRINT2(_L("!! USED REUSABLE POOL SEGS: addr=0x%x, reusable.Count()=%d"), addr, iReusablePagePool.Count()); |
179 } |
180 } |
180 // or we grow the touched region flag |
181 // or we grow the touched region flag |
181 else |
182 else |
182 { |
183 { |
183 addr = iBase + (iTouchedRegionFlag << iSegSizeInBytesLog2); |
184 addr = iBase + (iTouchedRegionFlag << iSegSizeInBytesLog2); |
184 iTouchedRegionFlag += aSegmentCount; |
185 touchedMore = ETrue; |
185 // __PRINT2(_L("!! GROW TOUCHED SEGS: addr=0x%x, touched=%d"), addr, iTouchedRegionFlag); |
186 // __PRINT2(_L("!! GROW TOUCHED SEGS: addr=0x%x, touched=%d"), addr, iTouchedRegionFlag); |
186 } |
187 } |
187 |
188 |
188 // parameter validation |
189 // parameter validation |
189 ASSERT(((addr - iBase) >> iSegSizeInBytesLog2) + aSegmentCount <= iMaxSizeInSegs); |
190 ASSERT(((addr - iBase) >> iSegSizeInBytesLog2) + aSegmentCount <= iMaxSizeInSegs); |