daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
daniel@transgaming.com | bbf56f7 | 2010-04-20 18:52:13 +0000 | [diff] [blame] | 7 | #include "compiler/PoolAlloc.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 8 | |
alokp@chromium.org | 1bcc3fd | 2010-05-19 17:08:44 +0000 | [diff] [blame] | 9 | #ifndef _MSC_VER |
| 10 | #include <stdint.h> |
| 11 | #endif |
alokp@chromium.org | 89b0543 | 2010-05-19 20:13:10 +0000 | [diff] [blame] | 12 | #include <stdio.h> |
alokp@chromium.org | 1bcc3fd | 2010-05-19 17:08:44 +0000 | [diff] [blame] | 13 | |
alokp@chromium.org | 79fb101 | 2012-04-26 21:07:39 +0000 | [diff] [blame^] | 14 | #include "common/angleutils.h" |
daniel@transgaming.com | bbf56f7 | 2010-04-20 18:52:13 +0000 | [diff] [blame] | 15 | #include "compiler/InitializeGlobals.h" |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 16 | #include "compiler/osinclude.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 17 | |
alokp@chromium.org | ff42c63 | 2010-05-10 15:14:30 +0000 | [diff] [blame] | 18 | OS_TLSIndex PoolIndex = OS_INVALID_TLS_INDEX; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 19 | |
| 20 | void InitializeGlobalPools() |
| 21 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 22 | TThreadGlobalPools* globalPools= static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex)); |
| 23 | if (globalPools) |
| 24 | return; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 25 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 26 | TThreadGlobalPools* threadData = new TThreadGlobalPools(); |
alokp@chromium.org | bafcbaa | 2010-11-23 19:07:43 +0000 | [diff] [blame] | 27 | threadData->globalPoolAllocator = 0; |
| 28 | |
| 29 | OS_SetTLSValue(PoolIndex, threadData); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | void FreeGlobalPools() |
| 33 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 34 | // Release the allocated memory for this thread. |
| 35 | TThreadGlobalPools* globalPools= static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex)); |
| 36 | if (!globalPools) |
| 37 | return; |
alokp@chromium.org | bafcbaa | 2010-11-23 19:07:43 +0000 | [diff] [blame] | 38 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 39 | delete globalPools; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | bool InitializePoolIndex() |
| 43 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 44 | // Allocate a TLS index. |
| 45 | if ((PoolIndex = OS_AllocTLSIndex()) == OS_INVALID_TLS_INDEX) |
| 46 | return false; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 47 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 48 | return true; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | void FreePoolIndex() |
| 52 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 53 | // Release the TLS index. |
| 54 | OS_FreeTLSIndex(PoolIndex); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | TPoolAllocator& GetGlobalPoolAllocator() |
| 58 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 59 | TThreadGlobalPools* threadData = static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex)); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 60 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 61 | return *threadData->globalPoolAllocator; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 62 | } |
| 63 | |
alokp@chromium.org | bafcbaa | 2010-11-23 19:07:43 +0000 | [diff] [blame] | 64 | void SetGlobalPoolAllocator(TPoolAllocator* poolAllocator) |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 65 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 66 | TThreadGlobalPools* threadData = static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex)); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 67 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 68 | threadData->globalPoolAllocator = poolAllocator; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | // |
| 72 | // Implement the functionality of the TPoolAllocator class, which |
| 73 | // is documented in PoolAlloc.h. |
| 74 | // |
alokp@chromium.org | bafcbaa | 2010-11-23 19:07:43 +0000 | [diff] [blame] | 75 | TPoolAllocator::TPoolAllocator(int growthIncrement, int allocationAlignment) : |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 76 | pageSize(growthIncrement), |
| 77 | alignment(allocationAlignment), |
| 78 | freeList(0), |
| 79 | inUseList(0), |
alokp@chromium.org | 18895cb | 2010-10-14 16:09:57 +0000 | [diff] [blame] | 80 | numCalls(0), |
| 81 | totalBytes(0) |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 82 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 83 | // |
| 84 | // Don't allow page sizes we know are smaller than all common |
| 85 | // OS page sizes. |
| 86 | // |
| 87 | if (pageSize < 4*1024) |
| 88 | pageSize = 4*1024; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 89 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 90 | // |
| 91 | // A large currentPageOffset indicates a new page needs to |
| 92 | // be obtained to allocate memory. |
| 93 | // |
| 94 | currentPageOffset = pageSize; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 95 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 96 | // |
| 97 | // Adjust alignment to be at least pointer aligned and |
| 98 | // power of 2. |
| 99 | // |
| 100 | size_t minAlign = sizeof(void*); |
| 101 | alignment &= ~(minAlign - 1); |
| 102 | if (alignment < minAlign) |
| 103 | alignment = minAlign; |
| 104 | size_t a = 1; |
| 105 | while (a < alignment) |
| 106 | a <<= 1; |
| 107 | alignment = a; |
| 108 | alignmentMask = a - 1; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 109 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 110 | // |
| 111 | // Align header skip |
| 112 | // |
| 113 | headerSkip = minAlign; |
| 114 | if (headerSkip < sizeof(tHeader)) { |
| 115 | headerSkip = (sizeof(tHeader) + alignmentMask) & ~alignmentMask; |
| 116 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | TPoolAllocator::~TPoolAllocator() |
| 120 | { |
alokp@chromium.org | bafcbaa | 2010-11-23 19:07:43 +0000 | [diff] [blame] | 121 | while (inUseList) { |
| 122 | tHeader* next = inUseList->nextPage; |
| 123 | inUseList->~tHeader(); |
| 124 | delete [] reinterpret_cast<char*>(inUseList); |
| 125 | inUseList = next; |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 126 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 127 | |
alokp@chromium.org | bafcbaa | 2010-11-23 19:07:43 +0000 | [diff] [blame] | 128 | // We should not check the guard blocks |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 129 | // here, because we did it already when the block was |
| 130 | // placed into the free list. |
| 131 | // |
| 132 | while (freeList) { |
| 133 | tHeader* next = freeList->nextPage; |
| 134 | delete [] reinterpret_cast<char*>(freeList); |
| 135 | freeList = next; |
| 136 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | // Support MSVC++ 6.0 |
| 140 | const unsigned char TAllocation::guardBlockBeginVal = 0xfb; |
| 141 | const unsigned char TAllocation::guardBlockEndVal = 0xfe; |
| 142 | const unsigned char TAllocation::userDataFill = 0xcd; |
| 143 | |
alokp@chromium.org | b1e8c6f | 2010-05-12 18:35:53 +0000 | [diff] [blame] | 144 | #ifdef GUARD_BLOCKS |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 145 | const size_t TAllocation::guardBlockSize = 16; |
alokp@chromium.org | b1e8c6f | 2010-05-12 18:35:53 +0000 | [diff] [blame] | 146 | #else |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 147 | const size_t TAllocation::guardBlockSize = 0; |
alokp@chromium.org | b1e8c6f | 2010-05-12 18:35:53 +0000 | [diff] [blame] | 148 | #endif |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 149 | |
| 150 | // |
| 151 | // Check a single guard block for damage |
| 152 | // |
| 153 | void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, const char* locText) const |
| 154 | { |
daniel@transgaming.com | b969cc5 | 2011-03-15 18:23:59 +0000 | [diff] [blame] | 155 | #ifdef GUARD_BLOCKS |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 156 | for (size_t x = 0; x < guardBlockSize; x++) { |
| 157 | if (blockMem[x] != val) { |
| 158 | char assertMsg[80]; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 159 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 160 | // We don't print the assert message. It's here just to be helpful. |
apatrick@chromium.org | e431963 | 2012-01-27 22:13:17 +0000 | [diff] [blame] | 161 | #if defined(_MSC_VER) |
kbr@chromium.org | ddb6e8e | 2012-04-25 00:48:13 +0000 | [diff] [blame] | 162 | snprintf(assertMsg, sizeof(assertMsg), "PoolAlloc: Damage %s %Iu byte allocation at 0x%p\n", |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 163 | locText, size, data()); |
apatrick@chromium.org | e431963 | 2012-01-27 22:13:17 +0000 | [diff] [blame] | 164 | #else |
kbr@chromium.org | ddb6e8e | 2012-04-25 00:48:13 +0000 | [diff] [blame] | 165 | snprintf(assertMsg, sizeof(assertMsg), "PoolAlloc: Damage %s %zu byte allocation at 0x%p\n", |
apatrick@chromium.org | e431963 | 2012-01-27 22:13:17 +0000 | [diff] [blame] | 166 | locText, size, data()); |
| 167 | #endif |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 168 | assert(0 && "PoolAlloc: Damage in guard block"); |
| 169 | } |
| 170 | } |
daniel@transgaming.com | b969cc5 | 2011-03-15 18:23:59 +0000 | [diff] [blame] | 171 | #endif |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | |
| 175 | void TPoolAllocator::push() |
| 176 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 177 | tAllocState state = { currentPageOffset, inUseList }; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 178 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 179 | stack.push_back(state); |
| 180 | |
| 181 | // |
| 182 | // Indicate there is no current page to allocate from. |
| 183 | // |
| 184 | currentPageOffset = pageSize; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | // |
| 188 | // Do a mass-deallocation of all the individual allocations |
| 189 | // that have occurred since the last push(), or since the |
| 190 | // last pop(), or since the object's creation. |
| 191 | // |
| 192 | // The deallocated pages are saved for future allocations. |
| 193 | // |
| 194 | void TPoolAllocator::pop() |
| 195 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 196 | if (stack.size() < 1) |
| 197 | return; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 198 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 199 | tHeader* page = stack.back().page; |
| 200 | currentPageOffset = stack.back().offset; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 201 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 202 | while (inUseList != page) { |
| 203 | // invoke destructor to free allocation list |
| 204 | inUseList->~tHeader(); |
| 205 | |
| 206 | tHeader* nextInUse = inUseList->nextPage; |
| 207 | if (inUseList->pageCount > 1) |
| 208 | delete [] reinterpret_cast<char*>(inUseList); |
| 209 | else { |
| 210 | inUseList->nextPage = freeList; |
| 211 | freeList = inUseList; |
| 212 | } |
| 213 | inUseList = nextInUse; |
| 214 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 215 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 216 | stack.pop_back(); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | // |
| 220 | // Do a mass-deallocation of all the individual allocations |
| 221 | // that have occurred. |
| 222 | // |
| 223 | void TPoolAllocator::popAll() |
| 224 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 225 | while (stack.size() > 0) |
| 226 | pop(); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | void* TPoolAllocator::allocate(size_t numBytes) |
| 230 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 231 | // If we are using guard blocks, all allocations are bracketed by |
| 232 | // them: [guardblock][allocation][guardblock]. numBytes is how |
| 233 | // much memory the caller asked for. allocationSize is the total |
| 234 | // size including guard blocks. In release build, |
| 235 | // guardBlockSize=0 and this all gets optimized away. |
| 236 | size_t allocationSize = TAllocation::allocationSize(numBytes); |
| 237 | |
| 238 | // |
| 239 | // Just keep some interesting statistics. |
| 240 | // |
| 241 | ++numCalls; |
| 242 | totalBytes += numBytes; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 243 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 244 | // |
| 245 | // Do the allocation, most likely case first, for efficiency. |
| 246 | // This step could be moved to be inline sometime. |
| 247 | // |
| 248 | if (currentPageOffset + allocationSize <= pageSize) { |
| 249 | // |
| 250 | // Safe to allocate from currentPageOffset. |
| 251 | // |
| 252 | unsigned char* memory = reinterpret_cast<unsigned char *>(inUseList) + currentPageOffset; |
| 253 | currentPageOffset += allocationSize; |
| 254 | currentPageOffset = (currentPageOffset + alignmentMask) & ~alignmentMask; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 255 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 256 | return initializeAllocation(inUseList, memory, numBytes); |
| 257 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 258 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 259 | if (allocationSize + headerSkip > pageSize) { |
| 260 | // |
| 261 | // Do a multi-page allocation. Don't mix these with the others. |
| 262 | // The OS is efficient and allocating and free-ing multiple pages. |
| 263 | // |
| 264 | size_t numBytesToAlloc = allocationSize + headerSkip; |
| 265 | tHeader* memory = reinterpret_cast<tHeader*>(::new char[numBytesToAlloc]); |
| 266 | if (memory == 0) |
| 267 | return 0; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 268 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 269 | // Use placement-new to initialize header |
| 270 | new(memory) tHeader(inUseList, (numBytesToAlloc + pageSize - 1) / pageSize); |
| 271 | inUseList = memory; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 272 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 273 | currentPageOffset = pageSize; // make next allocation come from a new page |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 274 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 275 | // No guard blocks for multi-page allocations (yet) |
| 276 | return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(memory) + headerSkip); |
| 277 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 278 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 279 | // |
| 280 | // Need a simple page to allocate from. |
| 281 | // |
| 282 | tHeader* memory; |
| 283 | if (freeList) { |
| 284 | memory = freeList; |
| 285 | freeList = freeList->nextPage; |
| 286 | } else { |
| 287 | memory = reinterpret_cast<tHeader*>(::new char[pageSize]); |
| 288 | if (memory == 0) |
| 289 | return 0; |
| 290 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 291 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 292 | // Use placement-new to initialize header |
| 293 | new(memory) tHeader(inUseList, 1); |
| 294 | inUseList = memory; |
| 295 | |
| 296 | unsigned char* ret = reinterpret_cast<unsigned char *>(inUseList) + headerSkip; |
| 297 | currentPageOffset = (headerSkip + allocationSize + alignmentMask) & ~alignmentMask; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 298 | |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 299 | return initializeAllocation(inUseList, ret, numBytes); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | |
| 303 | // |
| 304 | // Check all allocations in a list for damage by calling check on each. |
| 305 | // |
| 306 | void TAllocation::checkAllocList() const |
| 307 | { |
alokp@chromium.org | 4e89d23 | 2010-05-14 19:37:21 +0000 | [diff] [blame] | 308 | for (const TAllocation* alloc = this; alloc != 0; alloc = alloc->prevAlloc) |
| 309 | alloc->check(); |
daniel@transgaming.com | b969cc5 | 2011-03-15 18:23:59 +0000 | [diff] [blame] | 310 | } |