OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
| 8 #include "GrAllocPool.h" |
9 | 9 |
10 | 10 #include "GrTypes.h" |
11 #include "GrAllocPool.h" | |
12 | 11 |
13 #define GrAllocPool_MIN_BLOCK_SIZE ((size_t)128) | 12 #define GrAllocPool_MIN_BLOCK_SIZE ((size_t)128) |
14 | 13 |
15 struct GrAllocPool::Block { | 14 struct GrAllocPool::Block { |
16 Block* fNext; | 15 Block* fNext; |
17 char* fPtr; | 16 char* fPtr; |
18 size_t fBytesFree; | 17 size_t fBytesFree; |
19 size_t fBytesTotal; | 18 size_t fBytesTotal; |
20 | 19 |
21 static Block* Create(size_t size, Block* next) { | 20 static Block* Create(size_t size, Block* next) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 Block* block = fBlock; | 107 Block* block = fBlock; |
109 int count = 0; | 108 int count = 0; |
110 while (block) { | 109 while (block) { |
111 count += 1; | 110 count += 1; |
112 block = block->fNext; | 111 block = block->fNext; |
113 } | 112 } |
114 SkASSERT(fBlocksAllocated == count); | 113 SkASSERT(fBlocksAllocated == count); |
115 } | 114 } |
116 | 115 |
117 #endif | 116 #endif |
OLD | NEW |