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

Unified Diff: include/core/SkTArray.h

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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkRefCnt.h ('k') | include/core/SkTDArray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTArray.h
diff --git a/include/core/SkTArray.h b/include/core/SkTArray.h
index 9dc5880d245fa7b428f4aa44d7bc9f3bbd6b4d08..d67956be32906a94cead365f2ecd9c87c52a9aec 100644
--- a/include/core/SkTArray.h
+++ b/include/core/SkTArray.h
@@ -32,18 +32,18 @@ inline void copyAndDelete(SkTArray<T, true>* self, char* newMemArray) {
template<typename T>
inline void copy(SkTArray<T, false>* self, int dst, int src) {
- SkNEW_PLACEMENT_ARGS(&self->fItemArray[dst], T, (self->fItemArray[src]));
+ new (&self->fItemArray[dst]) T(self->fItemArray[src]);
}
template<typename T>
inline void copy(SkTArray<T, false>* self, const T* array) {
for (int i = 0; i < self->fCount; ++i) {
- SkNEW_PLACEMENT_ARGS(self->fItemArray + i, T, (array[i]));
+ new (self->fItemArray + i) T(array[i]);
}
}
template<typename T>
inline void copyAndDelete(SkTArray<T, false>* self, char* newMemArray) {
for (int i = 0; i < self->fCount; ++i) {
- SkNEW_PLACEMENT_ARGS(newMemArray + sizeof(T) * i, T, (self->fItemArray[i]));
+ new (newMemArray + sizeof(T) * i) T(self->fItemArray[i]);
self->fItemArray[i].~T();
}
}
@@ -135,7 +135,7 @@ public:
this->checkRealloc(n);
fCount = n;
for (int i = 0; i < fCount; ++i) {
- SkNEW_PLACEMENT(fItemArray + i, T);
+ new (fItemArray + i) T;
}
}
@@ -180,7 +180,7 @@ public:
*/
T& push_back() {
T* newT = reinterpret_cast<T*>(this->push_back_raw(1));
- SkNEW_PLACEMENT(newT, T);
+ new (newT) T;
return *newT;
}
@@ -189,7 +189,7 @@ public:
*/
T& push_back(const T& t) {
T* newT = reinterpret_cast<T*>(this->push_back_raw(1));
- SkNEW_PLACEMENT_ARGS(newT, T, (t));
+ new (newT) T(t);
return *newT;
}
@@ -202,7 +202,7 @@ public:
SkASSERT(n >= 0);
T* newTs = reinterpret_cast<T*>(this->push_back_raw(n));
for (int i = 0; i < n; ++i) {
- SkNEW_PLACEMENT(newTs + i, T);
+ new (newTs + i) T;
}
return newTs;
}
@@ -215,7 +215,7 @@ public:
SkASSERT(n >= 0);
T* newTs = reinterpret_cast<T*>(this->push_back_raw(n));
for (int i = 0; i < n; ++i) {
- SkNEW_PLACEMENT_ARGS(newTs[i], T, (t));
+ new (newTs[i]) T(t);
}
return newTs;
}
@@ -228,7 +228,7 @@ public:
SkASSERT(n >= 0);
this->checkRealloc(n);
for (int i = 0; i < n; ++i) {
- SkNEW_PLACEMENT_ARGS(fItemArray + fCount + i, T, (t[i]));
+ new (fItemArray + fCount + i) T(t[i]);
}
fCount += n;
return fItemArray + fCount - n;
« no previous file with comments | « include/core/SkRefCnt.h ('k') | include/core/SkTDArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698