From be1786f7b0e692d8f4326dbf53e7d0689813ee2d Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 26 Apr 2018 17:59:36 +0200 Subject: Remove support for system jemalloc. --- memory/build/jemalloc_config.cpp | 4 --- memory/build/moz.build | 3 +-- memory/build/mozjemalloc_compat.c | 6 +---- memory/build/mozmemory_wrap.h | 57 ++++++++++++++++++--------------------- memory/build/replace_malloc.c | 4 --- 5 files changed, 28 insertions(+), 46 deletions(-) (limited to 'memory/build') diff --git a/memory/build/jemalloc_config.cpp b/memory/build/jemalloc_config.cpp index 441fd8a2b9..1a83c79e20 100644 --- a/memory/build/jemalloc_config.cpp +++ b/memory/build/jemalloc_config.cpp @@ -11,12 +11,8 @@ #include #include "mozilla/Types.h" -#if defined(MOZ_SYSTEM_JEMALLOC) -#include MALLOC_H -#else #define DLLEXPORT #include "jemalloc/jemalloc.h" -#endif #ifdef XP_WIN #include diff --git a/memory/build/moz.build b/memory/build/moz.build index 8d80561b1d..bd6c2503e9 100644 --- a/memory/build/moz.build +++ b/memory/build/moz.build @@ -46,8 +46,7 @@ if CONFIG['MOZ_GLUE_IN_PROGRAM']: DIST_INSTALL = True # Keep jemalloc separated when mozglue is statically linked -if CONFIG['MOZ_MEMORY'] and (CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') or - CONFIG['MOZ_SYSTEM_JEMALLOC']): +if CONFIG['MOZ_MEMORY'] and CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'): FINAL_LIBRARY = 'mozglue' if CONFIG['MOZ_REPLACE_MALLOC'] and CONFIG['OS_TARGET'] == 'Darwin': diff --git a/memory/build/mozjemalloc_compat.c b/memory/build/mozjemalloc_compat.c index 6591892c13..0b3b333d41 100644 --- a/memory/build/mozjemalloc_compat.c +++ b/memory/build/mozjemalloc_compat.c @@ -14,11 +14,7 @@ #include -#if defined(MOZ_SYSTEM_JEMALLOC) -# include MALLOC_H -#else -# include "jemalloc/jemalloc.h" -#endif +#include "jemalloc/jemalloc.h" /* * CTL_* macros are from memory/jemalloc/src/src/stats.c with changes: diff --git a/memory/build/mozmemory_wrap.h b/memory/build/mozmemory_wrap.h index 066d57782d..fd53531c15 100644 --- a/memory/build/mozmemory_wrap.h +++ b/memory/build/mozmemory_wrap.h @@ -125,43 +125,38 @@ #include "mozilla/Types.h" -#if !defined(MOZ_SYSTEM_JEMALLOC) -# ifdef MOZ_MEMORY_IMPL -# if defined(MOZ_JEMALLOC_IMPL) && defined(MOZ_REPLACE_MALLOC) && !defined(MOZ_REPLACE_JEMALLOC) -# define mozmem_malloc_impl(a) je_ ## a -# define mozmem_jemalloc_impl(a) je_ ## a -# else -# define MOZ_JEMALLOC_API MFBT_API -# ifdef MOZ_REPLACE_JEMALLOC -# define MOZ_MEMORY_API MFBT_API -# define mozmem_malloc_impl(a) replace_ ## a -# define mozmem_jemalloc_impl(a) replace_ ## a -# elif (defined(XP_WIN) || defined(XP_DARWIN)) -# if defined(MOZ_REPLACE_MALLOC) -# define mozmem_malloc_impl(a) a ## _impl -# else -# define mozmem_malloc_impl(a) je_ ## a -# endif +#ifdef MOZ_MEMORY_IMPL +# if defined(MOZ_JEMALLOC_IMPL) && defined(MOZ_REPLACE_MALLOC) && !defined(MOZ_REPLACE_JEMALLOC) +# define mozmem_malloc_impl(a) je_ ## a +# define mozmem_jemalloc_impl(a) je_ ## a +# else +# define MOZ_JEMALLOC_API MFBT_API +# ifdef MOZ_REPLACE_JEMALLOC +# define MOZ_MEMORY_API MFBT_API +# define mozmem_malloc_impl(a) replace_ ## a +# define mozmem_jemalloc_impl(a) replace_ ## a +# elif (defined(XP_WIN) || defined(XP_DARWIN)) +# if defined(MOZ_REPLACE_MALLOC) +# define mozmem_malloc_impl(a) a ## _impl # else -# define MOZ_MEMORY_API MFBT_API -# if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) -# define MOZ_WRAP_NEW_DELETE -# endif +# define mozmem_malloc_impl(a) je_ ## a +# endif +# else +# define MOZ_MEMORY_API MFBT_API +# if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +# define MOZ_WRAP_NEW_DELETE # endif -# endif -# ifdef XP_WIN -# define mozmem_dup_impl(a) wrap_ ## a # endif # endif - -/* All other jemalloc3 functions are prefixed with "je_", except when - * building against an unprefixed system jemalloc library */ -# define je_(a) je_ ## a -#else /* defined(MOZ_SYSTEM_JEMALLOC) */ -# define je_(a) a +# ifdef XP_WIN +# define mozmem_dup_impl(a) wrap_ ## a +# endif #endif -#if !defined(MOZ_MEMORY_IMPL) || defined(MOZ_SYSTEM_JEMALLOC) +/* All other jemalloc3 functions are prefixed with "je_" */ +#define je_(a) je_ ## a + +#if !defined(MOZ_MEMORY_IMPL) # define MOZ_MEMORY_API MFBT_API # define MOZ_JEMALLOC_API MFBT_API #endif diff --git a/memory/build/replace_malloc.c b/memory/build/replace_malloc.c index 26dd8c2d6b..f4c7eb8788 100644 --- a/memory/build/replace_malloc.c +++ b/memory/build/replace_malloc.c @@ -10,10 +10,6 @@ # error Should not compile this file when replace-malloc is disabled #endif -#ifdef MOZ_SYSTEM_JEMALLOC -# error Should not compile this file when we want to use native jemalloc -#endif - #include "mozmemory_wrap.h" /* Declare all je_* functions */ -- cgit v1.2.3