diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 09:07:42 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 09:07:42 +0200 |
commit | aff03b0a67c41cf7af5df9c9eef715a8b27a2667 (patch) | |
tree | aa2909ae4718f81c83c8cfb68c1f5a23485b3173 /memory/build/mozmemory_wrap.h | |
parent | bdb4ff581677ad1cd411b55a68c87534f9a64882 (diff) | |
parent | 11caf6ecb3cb8c84d2355a6c6e9580a290147e92 (diff) | |
download | UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.tar UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.tar.gz UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.tar.lz UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.tar.xz UXP-aff03b0a67c41cf7af5df9c9eef715a8b27a2667.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into js_dom_performance-resource-timing_1
Diffstat (limited to 'memory/build/mozmemory_wrap.h')
-rw-r--r-- | memory/build/mozmemory_wrap.h | 64 |
1 files changed, 23 insertions, 41 deletions
diff --git a/memory/build/mozmemory_wrap.h b/memory/build/mozmemory_wrap.h index 066d57782..5d718e75e 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 @@ -125,43 +119,31 @@ #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) +# define mozmem_malloc_impl(a) je_ ## a +# define mozmem_jemalloc_impl(a) je_ ## a +# else +# define MOZ_JEMALLOC_API MFBT_API +# if (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) +#if !defined(MOZ_MEMORY_IMPL) # define MOZ_MEMORY_API MFBT_API # define MOZ_JEMALLOC_API MFBT_API #endif |