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

Side by Side Diff: src/core/SkTLS.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/core/SkTLList.h ('k') | src/core/SkTMultiMap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "SkTLS.h" 1 #include "SkTLS.h"
2 2
3 // enable to help debug TLS storage 3 // enable to help debug TLS storage
4 //#define SK_TRACE_TLS_LIFETIME 4 //#define SK_TRACE_TLS_LIFETIME
5 5
6 6
7 #ifdef SK_TRACE_TLS_LIFETIME 7 #ifdef SK_TRACE_TLS_LIFETIME
8 #include "SkThread.h" 8 #include "SkThread.h"
9 static int32_t gTLSRecCount; 9 static int32_t gTLSRecCount;
10 #endif 10 #endif
(...skipping 27 matching lines...) Expand all
38 void SkTLS::Destructor(void* ptr) { 38 void SkTLS::Destructor(void* ptr) {
39 #ifdef SK_TRACE_TLS_LIFETIME 39 #ifdef SK_TRACE_TLS_LIFETIME
40 SkDebugf("SkTLS::Destructor(%p)\n", ptr); 40 SkDebugf("SkTLS::Destructor(%p)\n", ptr);
41 #endif 41 #endif
42 42
43 SkTLSRec* rec = (SkTLSRec*)ptr; 43 SkTLSRec* rec = (SkTLSRec*)ptr;
44 do { 44 do {
45 SkTLSRec* next = rec->fNext; 45 SkTLSRec* next = rec->fNext;
46 SkDELETE(rec); 46 SkDELETE(rec);
47 rec = next; 47 rec = next;
48 } while (NULL != rec); 48 } while (rec);
49 } 49 }
50 50
51 void* SkTLS::Get(CreateProc createProc, DeleteProc deleteProc) { 51 void* SkTLS::Get(CreateProc createProc, DeleteProc deleteProc) {
52 if (NULL == createProc) { 52 if (NULL == createProc) {
53 return NULL; 53 return NULL;
54 } 54 }
55 55
56 void* ptr = SkTLS::PlatformGetSpecific(true); 56 void* ptr = SkTLS::PlatformGetSpecific(true);
57 57
58 if (ptr) { 58 if (ptr) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // we have a new head of our chain 114 // we have a new head of our chain
115 SkTLS::PlatformSetSpecific(next); 115 SkTLS::PlatformSetSpecific(next);
116 } 116 }
117 SkDELETE(curr); 117 SkDELETE(curr);
118 break; 118 break;
119 } 119 }
120 prev = curr; 120 prev = curr;
121 curr = next; 121 curr = next;
122 } 122 }
123 } 123 }
OLDNEW
« no previous file with comments | « src/core/SkTLList.h ('k') | src/core/SkTMultiMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698