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

Unified Diff: base/allocator/allocator_shim_override_glibc_weak_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_glibc_weak_symbols.h
diff --git a/base/allocator/allocator_shim_override_glibc_weak_symbols.h b/base/allocator/allocator_shim_override_glibc_weak_symbols.h
index a0b46183fc3c1601df6ad24aca9eb82766afcf81..b1296369c1ec123aa101b0e10164244420252808 100644
--- a/base/allocator/allocator_shim_override_glibc_weak_symbols.h
+++ b/base/allocator/allocator_shim_override_glibc_weak_symbols.h
@@ -76,30 +76,41 @@ SHIM_ALWAYS_EXPORT void* (*MALLOC_HOOK_MAYBE_VOLATILE __memalign_hook)(
// 2) Redefine libc symbols themselves.
-SHIM_ALWAYS_EXPORT void* __libc_malloc(size_t size)
- SHIM_ALIAS_SYMBOL(ShimMalloc);
+SHIM_ALWAYS_EXPORT void* __libc_malloc(size_t size) {
+ return ShimMalloc(size, nullptr);
+}
-SHIM_ALWAYS_EXPORT void __libc_free(void* ptr) SHIM_ALIAS_SYMBOL(ShimFree);
+SHIM_ALWAYS_EXPORT void __libc_free(void* ptr) {
+ ShimFree(ptr, nullptr);
+}
-SHIM_ALWAYS_EXPORT void* __libc_realloc(void* ptr, size_t size)
- SHIM_ALIAS_SYMBOL(ShimRealloc);
+SHIM_ALWAYS_EXPORT void* __libc_realloc(void* ptr, size_t size) {
+ return ShimRealloc(ptr, size, nullptr);
+}
-SHIM_ALWAYS_EXPORT void* __libc_calloc(size_t n, size_t size)
- SHIM_ALIAS_SYMBOL(ShimCalloc);
+SHIM_ALWAYS_EXPORT void* __libc_calloc(size_t n, size_t size) {
+ return ShimCalloc(n, size, nullptr);
+}
-SHIM_ALWAYS_EXPORT void __libc_cfree(void* ptr) SHIM_ALIAS_SYMBOL(ShimFree);
+SHIM_ALWAYS_EXPORT void __libc_cfree(void* ptr) {
+ return ShimFree(ptr, nullptr);
+}
-SHIM_ALWAYS_EXPORT void* __libc_memalign(size_t align, size_t s)
- SHIM_ALIAS_SYMBOL(ShimMemalign);
+SHIM_ALWAYS_EXPORT void* __libc_memalign(size_t align, size_t s) {
+ return ShimMemalign(align, s, nullptr);
+}
-SHIM_ALWAYS_EXPORT void* __libc_valloc(size_t size)
- SHIM_ALIAS_SYMBOL(ShimValloc);
+SHIM_ALWAYS_EXPORT void* __libc_valloc(size_t size) {
+ return ShimValloc(size, nullptr);
+}
-SHIM_ALWAYS_EXPORT void* __libc_pvalloc(size_t size)
- SHIM_ALIAS_SYMBOL(ShimPvalloc);
+SHIM_ALWAYS_EXPORT void* __libc_pvalloc(size_t size) {
+ return ShimPvalloc(size);
+}
-SHIM_ALWAYS_EXPORT int __posix_memalign(void** r, size_t a, size_t s)
- SHIM_ALIAS_SYMBOL(ShimPosixMemalign);
+SHIM_ALWAYS_EXPORT int __posix_memalign(void** r, size_t a, size_t s) {
+ return ShimPosixMemalign(r, a, s);
+}
} // extern "C"
« no previous file with comments | « base/allocator/allocator_shim_override_cpp_symbols.h ('k') | base/allocator/allocator_shim_override_libc_symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698