OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrMemoryPool.h" | 8 #include "GrMemoryPool.h" |
9 | 9 |
10 #if GR_DEBUG | 10 #if SK_DEBUG |
11 #define VALIDATE this->validate() | 11 #define VALIDATE this->validate() |
12 #else | 12 #else |
13 #define VALIDATE | 13 #define VALIDATE |
14 #endif | 14 #endif |
15 | 15 |
16 GrMemoryPool::GrMemoryPool(size_t preallocSize, size_t minAllocSize) { | 16 GrMemoryPool::GrMemoryPool(size_t preallocSize, size_t minAllocSize) { |
17 GR_DEBUGCODE(fAllocationCnt = 0); | 17 GR_DEBUGCODE(fAllocationCnt = 0); |
18 | 18 |
19 minAllocSize = GrMax<size_t>(minAllocSize, 1 << 10); | 19 minAllocSize = GrMax<size_t>(minAllocSize, 1 << 10); |
20 fMinAllocSize = GrSizeAlignUp(minAllocSize + kPerAllocPad, kAlignment), | 20 fMinAllocSize = GrSizeAlignUp(minAllocSize + kPerAllocPad, kAlignment), |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 SkASSERT(userStart == block->fCurrPtr); | 152 SkASSERT(userStart == block->fCurrPtr); |
153 } else { | 153 } else { |
154 SkASSERT(block == *reinterpret_cast<BlockHeader**>(userStart)); | 154 SkASSERT(block == *reinterpret_cast<BlockHeader**>(userStart)); |
155 } | 155 } |
156 prev = block; | 156 prev = block; |
157 } while ((block = block->fNext)); | 157 } while ((block = block->fNext)); |
158 SkASSERT(allocCount == fAllocationCnt); | 158 SkASSERT(allocCount == fAllocationCnt); |
159 SkASSERT(prev == fTail); | 159 SkASSERT(prev == fTail); |
160 #endif | 160 #endif |
161 } | 161 } |
OLD | NEW |