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

Unified Diff: base/allocator/generic_allocators.cc

Issue 447513002: Follow-up for https://codereview.chromium.org/419323002/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/generic_allocators.cc
diff --git a/base/allocator/generic_allocators.cc b/base/allocator/generic_allocators.cc
index 5b5f379148c99ec16595ef6d410c60bd5a1ae24c..d12f3b976ac274c4526cc25ad143b130f0ac0203 100644
--- a/base/allocator/generic_allocators.cc
+++ b/base/allocator/generic_allocators.cc
@@ -24,11 +24,11 @@ inline void* generic_cpp_alloc(size_t size, bool nothrow) {
extern "C++" {
-void* __cdecl operator new(size_t size) {
+void* operator new(size_t size) {
return generic_cpp_alloc(size, false);
}
-void operator delete(void* p) throw() {
+void operator delete(void* p) {
free(p);
}
@@ -36,18 +36,26 @@ void* operator new[](size_t size) {
return generic_cpp_alloc(size, false);
}
-void operator delete[](void* p) throw() {
+void operator delete[](void* p) {
free(p);
}
-void* operator new(size_t size, const std::nothrow_t& nt) throw() {
+void* operator new(size_t size, const std::nothrow_t& nt) {
return generic_cpp_alloc(size, true);
}
-void* operator new[](size_t size, const std::nothrow_t& nt) throw() {
+void operator delete(void* p, const std::nothrow_t& nt) {
+ free(p);
+}
+
+void* operator new[](size_t size, const std::nothrow_t& nt) {
return generic_cpp_alloc(size, true);
}
+void operator delete[](void* p, const std::nothrow_t& nt) {
+ free(p);
+}
+
// This function behaves similarly to MSVC's _set_new_mode.
// If flag is 0 (default), calls to malloc will behave normally.
// If flag is 1, calls to malloc will behave like calls to new,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698