Bug 1052573 - Separate the base allocator functions in malloc_decls.h. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 21 Sep 2017 10:31:09 +0900
changeset 382421 c447512b45a712a19f10feeddaa3ac90d9eef99f
parent 382420 05ad53f12a1bc0128d58fbfa1c61da44774c6a5e
child 382422 14342971a6c8c2a63e8378e2582e016271ac9d1d
push id32558
push userkwierso@gmail.com
push dateFri, 22 Sep 2017 21:29:46 +0000
treeherdermozilla-central@61e58a7d800b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1052573
milestone58.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 1052573 - Separate the base allocator functions in malloc_decls.h. r=njn malloc, free, calloc, realloc and memalign constitute some sort of minimal interface to the allocator. posix_memalign, aligned_alloc and valloc are already defined in terms of memalign. The remaining functions are not related to active allocation.
memory/build/malloc_decls.h
--- a/memory/build/malloc_decls.h
+++ b/memory/build/malloc_decls.h
@@ -10,44 +10,49 @@
  *   - argument types
  */
 
 #ifndef malloc_decls_h
 #  define malloc_decls_h
 
 #  include "mozjemalloc_types.h"
 
-#  define MALLOC_FUNCS_MALLOC 1
-#  define MALLOC_FUNCS_JEMALLOC 2
-#  define MALLOC_FUNCS_INIT 4
-#  define MALLOC_FUNCS_BRIDGE 8
+#  define MALLOC_FUNCS_MALLOC_BASE 1
+#  define MALLOC_FUNCS_MALLOC_EXTRA 2
+#  define MALLOC_FUNCS_MALLOC (MALLOC_FUNCS_MALLOC_BASE | \
+                               MALLOC_FUNCS_MALLOC_EXTRA)
+#  define MALLOC_FUNCS_JEMALLOC 4
+#  define MALLOC_FUNCS_INIT 8
+#  define MALLOC_FUNCS_BRIDGE 16
 #  define MALLOC_FUNCS_ALL (MALLOC_FUNCS_INIT | MALLOC_FUNCS_BRIDGE | \
                             MALLOC_FUNCS_MALLOC | MALLOC_FUNCS_JEMALLOC)
 
 #endif /* malloc_decls_h */
 
 #ifndef MALLOC_FUNCS
 #  define MALLOC_FUNCS (MALLOC_FUNCS_MALLOC | MALLOC_FUNCS_JEMALLOC)
 #endif
 
 #ifdef MALLOC_DECL
 #  if MALLOC_FUNCS & MALLOC_FUNCS_INIT
 MALLOC_DECL(init, void, const malloc_table_t *)
 #  endif
 #  if MALLOC_FUNCS & MALLOC_FUNCS_BRIDGE
 MALLOC_DECL(get_bridge, struct ReplaceMallocBridge*)
 #  endif
-#  if MALLOC_FUNCS & MALLOC_FUNCS_MALLOC
+#  if MALLOC_FUNCS & MALLOC_FUNCS_MALLOC_BASE
 MALLOC_DECL(malloc, void *, size_t)
-MALLOC_DECL(posix_memalign, int, void **, size_t, size_t)
-MALLOC_DECL(aligned_alloc, void *, size_t, size_t)
 MALLOC_DECL(calloc, void *, size_t, size_t)
 MALLOC_DECL(realloc, void *, void *, size_t)
 MALLOC_DECL(free, void, void *)
 MALLOC_DECL(memalign, void *, size_t, size_t)
+#  endif
+#  if MALLOC_FUNCS & MALLOC_FUNCS_MALLOC_EXTRA
+MALLOC_DECL(posix_memalign, int, void **, size_t, size_t)
+MALLOC_DECL(aligned_alloc, void *, size_t, size_t)
 MALLOC_DECL(valloc, void *, size_t)
 MALLOC_DECL(malloc_usable_size, size_t, usable_ptr_t)
 MALLOC_DECL(malloc_good_size, size_t, size_t)
 #  endif
 #  if MALLOC_FUNCS & MALLOC_FUNCS_JEMALLOC
 MALLOC_DECL(jemalloc_stats, void, jemalloc_stats_t *)
 /*
  * On some operating systems (Mac), we use madvise(MADV_FREE) to hand pages