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

Side by Side Diff: third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h

Issue 2128583004: Add a standard placement new operator to WTF_USE_ALLOCATOR. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « third_party/WebKit/Source/wtf/VectorTest.cpp ('k') | no next file » | 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 (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return Allocator::template malloc<void*, ClassName>(size, WTF_HEAP_PROFI LER_TYPE_NAME(ClassName)); \ 148 return Allocator::template malloc<void*, ClassName>(size, WTF_HEAP_PROFI LER_TYPE_NAME(ClassName)); \
149 } \ 149 } \
150 void operator delete(void* p) { Allocator::free(p); } \ 150 void operator delete(void* p) { Allocator::free(p); } \
151 void* operator new[](size_t size) { return Allocator::template newArray<Clas sName>(size); } \ 151 void* operator new[](size_t size) { return Allocator::template newArray<Clas sName>(size); } \
152 void operator delete[](void* p) { Allocator::deleteArray(p); } \ 152 void operator delete[](void* p) { Allocator::deleteArray(p); } \
153 void* operator new(size_t, NotNullTag, void* location) \ 153 void* operator new(size_t, NotNullTag, void* location) \
154 { \ 154 { \
155 ASSERT(location); \ 155 ASSERT(location); \
156 return location; \ 156 return location; \
157 } \ 157 } \
158 void* operator new(size_t, void* location) { return location; } \
158 private: \ 159 private: \
159 typedef int __thisIsHereToForceASemicolonAfterThisMacro 160 typedef int __thisIsHereToForceASemicolonAfterThisMacro
160 161
161 using WTF::PartitionAllocator; 162 using WTF::PartitionAllocator;
162 163
163 #endif // WTF_PartitionAllocator_h 164 #endif // WTF_PartitionAllocator_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/VectorTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698