Bug 1368932 - Don't rely on the default MALLOC_DECL_VOID for malloc function declarations in replace-malloc. r?njn
In practice, this induces no change in what the expanded code looks
like.
--- a/memory/build/replace_malloc.c
+++ b/memory/build/replace_malloc.c
@@ -101,24 +101,31 @@ replace_malloc_init_funcs()
*/
/*
* Malloc implementation functions are MOZ_MEMORY_API, and jemalloc
* specific functions MOZ_JEMALLOC_API; see mozmemory_wrap.h
*/
#define MACRO_CALL(a, b) a b
-#define GENERIC_MALLOC_DECL(name, return_type, ...) \
+#define GENERIC_MALLOC_DECL_HELPER(name, return_type, ...) \
return_type name ## _impl(__VA_ARGS__);
+#define GENERIC_MALLOC_DECL(name, return_type, ...) \
+ GENERIC_MALLOC_DECL_HELPER(name, return_type, ##__VA_ARGS__)
+#define GENERIC_MALLOC_DECL_VOID(name, ...) \
+ GENERIC_MALLOC_DECL_HELPER(name, void, ##__VA_ARGS__)
+
#define MALLOC_DECL(...) MOZ_MEMORY_API MACRO_CALL(GENERIC_MALLOC_DECL, (__VA_ARGS__))
+#define MALLOC_DECL_VOID(...) MOZ_MEMORY_API MACRO_CALL(GENERIC_MALLOC_DECL_VOID, (__VA_ARGS__))
#define MALLOC_FUNCS MALLOC_FUNCS_MALLOC
#include "malloc_decls.h"
#define MALLOC_DECL(...) MOZ_JEMALLOC_API MACRO_CALL(GENERIC_MALLOC_DECL, (__VA_ARGS__))
+#define MALLOC_DECL_VOID(...) MOZ_JEMALLOC_API MACRO_CALL(GENERIC_MALLOC_DECL_VOID, (__VA_ARGS__))
#define MALLOC_FUNCS MALLOC_FUNCS_JEMALLOC
#include "malloc_decls.h"
static int replace_malloc_initialized = 0;
static void
init()
{
#ifdef MOZ_NO_REPLACE_FUNC_DECL