Bug 1368932 - Factor out function declarations for malloc implementation. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 25 May 2017 15:54:05 +0900
changeset 361703 aa1bdb69c9e8bad0e1023ff9a0620ee4af65fbec
parent 361702 a92caa51ce41bab31559d322c95bd7a38104782e
child 361704 80496d55346d35f5d14d656acfafff60e0c1870e
push id31939
push usercbook@mozilla.com
push dateThu, 01 Jun 2017 11:49:28 +0000
treeherdermozilla-central@d96110d76619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1368932
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368932 - Factor out function declarations for malloc implementation. r=njn
memory/build/replace_malloc.c
--- a/memory/build/replace_malloc.c
+++ b/memory/build/replace_malloc.c
@@ -99,23 +99,26 @@ replace_malloc_init_funcs()
  * Below is the malloc implementation overriding jemalloc and calling the
  * replacement functions if they exist.
  */
 
 /*
  * Malloc implementation functions are MOZ_MEMORY_API, and jemalloc
  * specific functions MOZ_JEMALLOC_API; see mozmemory_wrap.h
  */
-#define MALLOC_DECL(name, return_type, ...) \
-  MOZ_MEMORY_API return_type name ## _impl(__VA_ARGS__);
+#define MACRO_CALL(a, b) a b
+
+#define GENERIC_MALLOC_DECL(name, return_type, ...) \
+  return_type name ## _impl(__VA_ARGS__);
+
+#define MALLOC_DECL(...) MOZ_MEMORY_API MACRO_CALL(GENERIC_MALLOC_DECL, (__VA_ARGS__))
 #define MALLOC_FUNCS MALLOC_FUNCS_MALLOC
 #include "malloc_decls.h"
 
-#define MALLOC_DECL(name, return_type, ...) \
-  MOZ_JEMALLOC_API return_type name ## _impl(__VA_ARGS__);
+#define MALLOC_DECL(...) MOZ_JEMALLOC_API MACRO_CALL(GENERIC_MALLOC_DECL, (__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