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/mozmemory_wrap.h | 57 ++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 31 deletions(-) (limited to 'memory/build/mozmemory_wrap.h') diff --git a/memory/build/mozmemory_wrap.h b/memory/build/mozmemory_wrap.h index 066d57782..fd53531c1 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 -- cgit v1.2.3 From 43034a36e132ac4394e26cbfb4d855bd6f5114b3 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 27 Apr 2018 19:16:45 +0200 Subject: Remove jemalloc 4 from our tree. --- memory/build/mozmemory_wrap.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'memory/build/mozmemory_wrap.h') diff --git a/memory/build/mozmemory_wrap.h b/memory/build/mozmemory_wrap.h index fd53531c1..39fc83940 100644 --- a/memory/build/mozmemory_wrap.h +++ b/memory/build/mozmemory_wrap.h @@ -36,8 +36,7 @@ * - jemalloc_stats * - jemalloc_purge_freed_pages * - jemalloc_free_dirty_pages - * (these functions are native to mozjemalloc, and have compatibility - * implementations for jemalloc3) + * (these functions are native to mozjemalloc) * * These functions are all exported as part of libmozglue (see * $(topsrcdir)/mozglue/build/Makefile.in), with a few implementation @@ -87,21 +86,16 @@ * char* strdup_impl(const char *) * That implementation would call malloc by using "malloc_impl". * - * While mozjemalloc uses these "_impl" suffixed helpers, jemalloc3, being - * third-party code, doesn't, but instead has an elaborate way to mangle - * individual functions. See under "Run jemalloc configure script" in - * $(topsrcdir)/configure.in. - * * * When building with replace-malloc support, the above still holds, but * the malloc implementation and jemalloc specific functions are the * replace-malloc functions from replace_malloc.c. * - * The actual jemalloc/mozjemalloc implementation is prefixed with "je_". + * The actual mozjemalloc implementation is prefixed with "je_". * * Thus, when MOZ_REPLACE_MALLOC is defined, the "_impl" suffixed macros - * expand to "je_" prefixed function when building mozjemalloc or - * jemalloc3/mozjemalloc_compat, where MOZ_JEMALLOC_IMPL is defined. + * expand to "je_" prefixed function when building mozjemalloc, where + * MOZ_JEMALLOC_IMPL is defined. * * In other cases, the "_impl" suffixed macros follow the original scheme, * except on Windows and MacOSX, where they would expand to "je_" prefixed @@ -153,9 +147,6 @@ # endif #endif -/* 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 -- cgit v1.2.3 From 9c0786757348a5b109bac8f3d04472357aa18b11 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 27 Apr 2018 20:23:28 +0200 Subject: Remove MOZ_REPLACE_JEMALLOC This was only defined when building jemalloc4 as a replace-malloc library. --- memory/build/mozmemory_wrap.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'memory/build/mozmemory_wrap.h') diff --git a/memory/build/mozmemory_wrap.h b/memory/build/mozmemory_wrap.h index 39fc83940..5d718e75e 100644 --- a/memory/build/mozmemory_wrap.h +++ b/memory/build/mozmemory_wrap.h @@ -120,16 +120,12 @@ #include "mozilla/Types.h" #ifdef MOZ_MEMORY_IMPL -# if defined(MOZ_JEMALLOC_IMPL) && defined(MOZ_REPLACE_MALLOC) && !defined(MOZ_REPLACE_JEMALLOC) +# if defined(MOZ_JEMALLOC_IMPL) && defined(MOZ_REPLACE_MALLOC) # 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(XP_WIN) || defined(XP_DARWIN)) # if defined(MOZ_REPLACE_MALLOC) # define mozmem_malloc_impl(a) a ## _impl # else -- cgit v1.2.3