OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 bytes = fBlock->release(bytes); | 95 bytes = fBlock->release(bytes); |
96 if (fBlock->empty()) { | 96 if (fBlock->empty()) { |
97 Block* next = fBlock->fNext; | 97 Block* next = fBlock->fNext; |
98 GrFree(fBlock); | 98 GrFree(fBlock); |
99 fBlock = next; | 99 fBlock = next; |
100 GR_DEBUGCODE(fBlocksAllocated -= 1;) | 100 GR_DEBUGCODE(fBlocksAllocated -= 1;) |
101 } | 101 } |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 | 105 #ifdef SK_DEBUG |
106 #if GR_DEBUG | |
107 | 106 |
108 void GrAllocPool::validate() const { | 107 void GrAllocPool::validate() const { |
109 Block* block = fBlock; | 108 Block* block = fBlock; |
110 int count = 0; | 109 int count = 0; |
111 while (block) { | 110 while (block) { |
112 count += 1; | 111 count += 1; |
113 block = block->fNext; | 112 block = block->fNext; |
114 } | 113 } |
115 SkASSERT(fBlocksAllocated == count); | 114 SkASSERT(fBlocksAllocated == count); |
116 } | 115 } |
117 | 116 |
118 #endif | 117 #endif |
OLD | NEW |