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.
--- 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