Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: src/gpu/GrMemoryPool.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrLayerHoister.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifdef SK_DEBUG 10 #ifdef SK_DEBUG
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 void GrMemoryPool::validate() { 121 void GrMemoryPool::validate() {
122 #ifdef SK_DEBUG 122 #ifdef SK_DEBUG
123 BlockHeader* block = fHead; 123 BlockHeader* block = fHead;
124 BlockHeader* prev = NULL; 124 BlockHeader* prev = NULL;
125 SkASSERT(block); 125 SkASSERT(block);
126 int allocCount = 0; 126 int allocCount = 0;
127 do { 127 do {
128 allocCount += block->fLiveCount; 128 allocCount += block->fLiveCount;
129 SkASSERT(prev == block->fPrev); 129 SkASSERT(prev == block->fPrev);
130 if (NULL != prev) { 130 if (prev) {
131 SkASSERT(prev->fNext == block); 131 SkASSERT(prev->fNext == block);
132 } 132 }
133 133
134 intptr_t b = reinterpret_cast<intptr_t>(block); 134 intptr_t b = reinterpret_cast<intptr_t>(block);
135 size_t ptrOffset = block->fCurrPtr - b; 135 size_t ptrOffset = block->fCurrPtr - b;
136 size_t totalSize = ptrOffset + block->fFreeSize; 136 size_t totalSize = ptrOffset + block->fFreeSize;
137 size_t userSize = totalSize - kHeaderSize; 137 size_t userSize = totalSize - kHeaderSize;
138 intptr_t userStart = b + kHeaderSize; 138 intptr_t userStart = b + kHeaderSize;
139 139
140 SkASSERT(!(b % kAlignment)); 140 SkASSERT(!(b % kAlignment));
(...skipping 11 matching lines...) Expand all
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrLayerHoister.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698