Bug 1400096 - Remove mozmem_malloc_impl wrapping for operator methods exposed in mozmemory_wrap.c. r?njn draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 15 Sep 2017 09:54:01 +0900
changeset 665198 af2a0f74748a205d5f7ab76218a0ead8ee866143
parent 665197 d88986fdf81fe4b85e229b46dac0e6482148778a
child 665199 52c6cc7b1d6e6607a9cc58f2788f9ff748fed264
push id79961
push userbmo:mh+mozilla@glandium.org
push dateFri, 15 Sep 2017 02:20:00 +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