Index: base/allocator/allocator_shim_override_libc_symbols.h |
diff --git a/base/allocator/allocator_shim_override_libc_symbols.h b/base/allocator/allocator_shim_override_libc_symbols.h |
index 37b3b4eb1219cde7292bb89dde826267eb78e7ce..b77cbb1fe9dc13fd07117459229792be0763da6b 100644 |
--- a/base/allocator/allocator_shim_override_libc_symbols.h |
+++ b/base/allocator/allocator_shim_override_libc_symbols.h |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-// Its purpose is to SHIM_ALIAS_SYMBOL the Libc symbols for malloc/new to the |
+// Its purpose is to preempt the Libc symbols for malloc/new so they call the |
// shim layer entry points. |
#ifdef BASE_ALLOCATOR_ALLOCATOR_SHIM_OVERRIDE_LIBC_SYMBOLS_H_ |
@@ -16,32 +16,41 @@ |
extern "C" { |
-SHIM_ALWAYS_EXPORT void* malloc(size_t size) __THROW |
- SHIM_ALIAS_SYMBOL(ShimMalloc); |
+SHIM_ALWAYS_EXPORT void* malloc(size_t size) __THROW { |
+ return ShimMalloc(size, nullptr); |
+} |
-SHIM_ALWAYS_EXPORT void free(void* ptr) __THROW |
- SHIM_ALIAS_SYMBOL(ShimFree); |
+SHIM_ALWAYS_EXPORT void free(void* ptr) __THROW { |
+ ShimFree(ptr, nullptr); |
+} |
-SHIM_ALWAYS_EXPORT void* realloc(void* ptr, size_t size) __THROW |
- SHIM_ALIAS_SYMBOL(ShimRealloc); |
+SHIM_ALWAYS_EXPORT void* realloc(void* ptr, size_t size) __THROW { |
+ return ShimRealloc(ptr, size, nullptr); |
+} |
-SHIM_ALWAYS_EXPORT void* calloc(size_t n, size_t size) __THROW |
- SHIM_ALIAS_SYMBOL(ShimCalloc); |
+SHIM_ALWAYS_EXPORT void* calloc(size_t n, size_t size) __THROW { |
+ return ShimCalloc(n, size, nullptr); |
+} |
-SHIM_ALWAYS_EXPORT void cfree(void* ptr) __THROW |
- SHIM_ALIAS_SYMBOL(ShimFree); |
+SHIM_ALWAYS_EXPORT void cfree(void* ptr) __THROW { |
+ ShimFree(ptr, nullptr); |
+} |
-SHIM_ALWAYS_EXPORT void* memalign(size_t align, size_t s) __THROW |
- SHIM_ALIAS_SYMBOL(ShimMemalign); |
+SHIM_ALWAYS_EXPORT void* memalign(size_t align, size_t s) __THROW { |
+ return ShimMemalign(align, s, nullptr); |
+} |
-SHIM_ALWAYS_EXPORT void* valloc(size_t size) __THROW |
- SHIM_ALIAS_SYMBOL(ShimValloc); |
+SHIM_ALWAYS_EXPORT void* valloc(size_t size) __THROW { |
+ return ShimValloc(size, nullptr); |
+} |
-SHIM_ALWAYS_EXPORT void* pvalloc(size_t size) __THROW |
- SHIM_ALIAS_SYMBOL(ShimPvalloc); |
+SHIM_ALWAYS_EXPORT void* pvalloc(size_t size) __THROW { |
+ return ShimPvalloc(size); |
+} |
-SHIM_ALWAYS_EXPORT int posix_memalign(void** r, size_t a, size_t s) __THROW |
- SHIM_ALIAS_SYMBOL(ShimPosixMemalign); |
+SHIM_ALWAYS_EXPORT int posix_memalign(void** r, size_t a, size_t s) __THROW { |
+ return ShimPosixMemalign(r, a, s); |
+} |
// The default dispatch translation unit has to define also the following |
// symbols (unless they are ultimately routed to the system symbols): |