Bug 1400096 - Remove mozmem_malloc_impl wrapping for operator methods exposed in mozmemory_wrap.c. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 15 Sep 2017 09:54:01 +0900
changeset 665559 6cf651d919d1aa049d0b88c1ca8f91c0c33ee56b
parent 665558 ba8d3ecc2412f0025e715a8ecd9a527ca44ef5e0
child 665560 092857175e36c1c9c0d8d74436f432dc57deba11
push id80115
push userbmo:eoger@fastmail.com
push dateFri, 15 Sep 2017 18:29:01 +0000
reviewersnjn
bugs1400096, 1077366
milestone57.0a1
Bug 1400096 - Remove mozmem_malloc_impl wrapping for operator methods exposed in mozmemory_wrap.c. r=njn This used to be necessary because those functions might be prefixed with __wrap_, and linked against with -Wl,--wrap, but that's not been the case since bug 1077366. Furthermore, mozmem_malloc_impl nowadays only does something on Windows, and those operators are only exposed on Android.
memory/build/mozmemory_wrap.c
--- a/memory/build/mozmemory_wrap.c
+++ b/memory/build/mozmemory_wrap.c
@@ -10,60 +10,60 @@
  * argument types. */
 #define MALLOC_DECL(name, return_type, ...) \
   MOZ_MEMORY_API return_type name ## _impl(__VA_ARGS__);
 #define MALLOC_FUNCS MALLOC_FUNCS_MALLOC
 #include "malloc_decls.h"
 
 #ifdef MOZ_WRAP_NEW_DELETE
 /* operator new(unsigned int) */
-MOZ_MEMORY_API void *
-mozmem_malloc_impl(_Znwj)(unsigned int size)
+MOZ_MEMORY_API void*
+_Znwj(unsigned int size)
 {
   return malloc_impl(size);
 }
 /* operator new[](unsigned int) */
-MOZ_MEMORY_API void *
-mozmem_malloc_impl(_Znaj)(unsigned int size)
+MOZ_MEMORY_API void*
+_Znaj(unsigned int size)
 {
   return malloc_impl(size);
 }
 /* operator delete(void*) */
 MOZ_MEMORY_API void
-mozmem_malloc_impl(_ZdlPv)(void *ptr)
+_ZdlPv(void* ptr)
 {
   free_impl(ptr);
 }
 /* operator delete[](void*) */
 MOZ_MEMORY_API void
-mozmem_malloc_impl(_ZdaPv)(void *ptr)
+_ZdaPv(void* ptr)
 {
   free_impl(ptr);
 }
 /*operator new(unsigned int, std::nothrow_t const&)*/
-MOZ_MEMORY_API void *
-mozmem_malloc_impl(_ZnwjRKSt9nothrow_t)(unsigned int size)
+MOZ_MEMORY_API void*
+_ZnwjRKSt9nothrow_t(unsigned int size)
 {
   return malloc_impl(size);
 }
 /*operator new[](unsigned int, std::nothrow_t const&)*/
-MOZ_MEMORY_API void *
-mozmem_malloc_impl(_ZnajRKSt9nothrow_t)(unsigned int size)
+MOZ_MEMORY_API void*
+_ZnajRKSt9nothrow_t(unsigned int size)
 {
   return malloc_impl(size);
 }
 /* operator delete(void*, std::nothrow_t const&) */
 MOZ_MEMORY_API void
-mozmem_malloc_impl(_ZdlPvRKSt9nothrow_t)(void *ptr)
+_ZdlPvRKSt9nothrow_t(void* ptr)
 {
   free_impl(ptr);
 }
 /* operator delete[](void*, std::nothrow_t const&) */
 MOZ_MEMORY_API void
-mozmem_malloc_impl(_ZdaPvRKSt9nothrow_t)(void *ptr)
+_ZdaPvRKSt9nothrow_t(void* ptr)
 {
   free_impl(ptr);
 }
 #endif
 
 /* strndup and strdup may be defined as macros in string.h, which would
  * clash with the definitions below. */
 #undef strndup