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

Unified Diff: base/allocator/allocator_shim_override_cpp_symbols.h

Issue 2720703004: allocator: Fix function type mismatch in allocator function definitions. (Closed)
Patch Set: Change shim functions to be ALWAYS_INLINE and replace all aliases with calls Created 3 years, 10 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
Index: base/allocator/allocator_shim_override_cpp_symbols.h
diff --git a/base/allocator/allocator_shim_override_cpp_symbols.h b/base/allocator/allocator_shim_override_cpp_symbols.h
index 616716fb96f0dda2bc94d18ab18616c5e9acc3f3..3313687250f4325111e8652cd6360284ab71b93f 100644
--- a/base/allocator/allocator_shim_override_cpp_symbols.h
+++ b/base/allocator/allocator_shim_override_cpp_symbols.h
@@ -7,36 +7,45 @@
#endif
#define BASE_ALLOCATOR_ALLOCATOR_SHIM_OVERRIDE_CPP_SYMBOLS_H_
-// Alias the default new/delete C++ symbols to the shim entry points.
-// This file is strongly inspired by tcmalloc's libc_override_redefine.h.
+// Preempt the default new/delete C++ symbols so they call the shim entry
+// points. This file is strongly inspired by tcmalloc's
+// libc_override_redefine.h.
#include <new>
#include "base/allocator/allocator_shim_internals.h"
-SHIM_ALWAYS_EXPORT void* operator new(size_t size)
- SHIM_ALIAS_SYMBOL(ShimCppNew);
+SHIM_ALWAYS_EXPORT void* operator new(size_t size) {
+ return ShimCppNew(size);
+}
-SHIM_ALWAYS_EXPORT void operator delete(void* p) __THROW
- SHIM_ALIAS_SYMBOL(ShimCppDelete);
+SHIM_ALWAYS_EXPORT void operator delete(void* p) __THROW {
+ ShimCppDelete(p);
+}
-SHIM_ALWAYS_EXPORT void* operator new[](size_t size)
- SHIM_ALIAS_SYMBOL(ShimCppNew);
+SHIM_ALWAYS_EXPORT void* operator new[](size_t size) {
+ return ShimCppNew(size);
+}
-SHIM_ALWAYS_EXPORT void operator delete[](void* p) __THROW
- SHIM_ALIAS_SYMBOL(ShimCppDelete);
+SHIM_ALWAYS_EXPORT void operator delete[](void* p) __THROW {
+ ShimCppDelete(p);
+}
SHIM_ALWAYS_EXPORT void* operator new(size_t size,
- const std::nothrow_t&) __THROW
- SHIM_ALIAS_SYMBOL(ShimCppNew);
+ const std::nothrow_t&) __THROW {
+ return ShimCppNew(size);
+}
SHIM_ALWAYS_EXPORT void* operator new[](size_t size,
- const std::nothrow_t&) __THROW
- SHIM_ALIAS_SYMBOL(ShimCppNew);
+ const std::nothrow_t&) __THROW {
+ return ShimCppNew(size);
+}
-SHIM_ALWAYS_EXPORT void operator delete(void* p, const std::nothrow_t&) __THROW
- SHIM_ALIAS_SYMBOL(ShimCppDelete);
+SHIM_ALWAYS_EXPORT void operator delete(void* p, const std::nothrow_t&) __THROW {
+ ShimCppDelete(p);
+}
SHIM_ALWAYS_EXPORT void operator delete[](void* p,
- const std::nothrow_t&) __THROW
- SHIM_ALIAS_SYMBOL(ShimCppDelete);
+ const std::nothrow_t&) __THROW {
+ ShimCppDelete(p);
+}
« no previous file with comments | « base/allocator/allocator_shim_internals.h ('k') | base/allocator/allocator_shim_override_glibc_weak_symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698