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

Side by Side Diff: src/core/SkTLS.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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 /* 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 "SkTLS.h" 8 #include "SkTLS.h"
9 9
10 // enable to help debug TLS storage 10 // enable to help debug TLS storage
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 }; 43 };
44 44
45 void SkTLS::Destructor(void* ptr) { 45 void SkTLS::Destructor(void* ptr) {
46 #ifdef SK_TRACE_TLS_LIFETIME 46 #ifdef SK_TRACE_TLS_LIFETIME
47 SkDebugf("SkTLS::Destructor(%p)\n", ptr); 47 SkDebugf("SkTLS::Destructor(%p)\n", ptr);
48 #endif 48 #endif
49 49
50 SkTLSRec* rec = (SkTLSRec*)ptr; 50 SkTLSRec* rec = (SkTLSRec*)ptr;
51 do { 51 do {
52 SkTLSRec* next = rec->fNext; 52 SkTLSRec* next = rec->fNext;
53 SkDELETE(rec); 53 delete rec;
54 rec = next; 54 rec = next;
55 } while (rec); 55 } while (rec);
56 } 56 }
57 57
58 void* SkTLS::Get(CreateProc createProc, DeleteProc deleteProc) { 58 void* SkTLS::Get(CreateProc createProc, DeleteProc deleteProc) {
59 if (NULL == createProc) { 59 if (NULL == createProc) {
60 return NULL; 60 return NULL;
61 } 61 }
62 62
63 void* ptr = SkTLS::PlatformGetSpecific(true); 63 void* ptr = SkTLS::PlatformGetSpecific(true);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 SkTLSRec* prev = NULL; 114 SkTLSRec* prev = NULL;
115 while (curr) { 115 while (curr) {
116 SkTLSRec* next = curr->fNext; 116 SkTLSRec* next = curr->fNext;
117 if (curr->fCreateProc == createProc) { 117 if (curr->fCreateProc == createProc) {
118 if (prev) { 118 if (prev) {
119 prev->fNext = next; 119 prev->fNext = next;
120 } else { 120 } else {
121 // we have a new head of our chain 121 // we have a new head of our chain
122 SkTLS::PlatformSetSpecific(next); 122 SkTLS::PlatformSetSpecific(next);
123 } 123 }
124 SkDELETE(curr); 124 delete curr;
125 break; 125 break;
126 } 126 }
127 prev = curr; 127 prev = curr;
128 curr = next; 128 curr = next;
129 } 129 }
130 } 130 }
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