Backed out changeset 261d61f4eeec (bug 1356701) for causing bug 1378339.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 05 Jul 2017 12:58:39 -0400
changeset 367368 11755fd63168581e194258d04bb6a7337779ec78
parent 367367 97a8f71407cc40b39d86d71a6907a5505d3eb867
child 367369 ed438053201937afc04589ca66417bb1644c09a0
child 367413 d6d15bc7f800787b19120f33daa9c95d903b307d
child 367463 11a7e159e79f2e32a6462f76995ff95f42c96db2
push id32132
push userryanvm@gmail.com
push dateWed, 05 Jul 2017 16:58:53 +0000
treeherdermozilla-central@11755fd63168 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1356701, 1378339
milestone56.0a1
backs out261d61f4eeecbcf143a816fbfd43476b511779de
first release with
nightly linux32
11755fd63168 / 56.0a1 / 20170705170343 / files
nightly linux64
11755fd63168 / 56.0a1 / 20170705170343 / files
nightly mac
11755fd63168 / 56.0a1 / 20170705170357 / files
nightly win32
11755fd63168 / 56.0a1 / 20170705095941 / files
nightly win64
11755fd63168 / 56.0a1 / 20170705095941 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 261d61f4eeec (bug 1356701) for causing bug 1378339.
memory/build/mozmemory_wrap.c
memory/build/mozmemory_wrap.h
--- a/memory/build/mozmemory_wrap.c
+++ b/memory/build/mozmemory_wrap.c
@@ -63,16 +63,17 @@ mozmem_malloc_impl(_ZdaPvRKSt9nothrow_t)
 }
 #endif
 
 /* strndup and strdup may be defined as macros in string.h, which would
  * clash with the definitions below. */
 #undef strndup
 #undef strdup
 
+#ifndef XP_DARWIN
 MOZ_MEMORY_API char *
 strndup_impl(const char *src, size_t len)
 {
   char* dst = (char*) malloc_impl(len + 1);
   if (dst) {
     strncpy(dst, src, len);
     dst[len] = '\0';
   }
@@ -80,16 +81,17 @@ strndup_impl(const char *src, size_t len
 }
 
 MOZ_MEMORY_API char *
 strdup_impl(const char *src)
 {
   size_t len = strlen(src);
   return strndup_impl(src, len);
 }
+#endif /* XP_DARWIN */
 
 #ifdef ANDROID
 #include <stdarg.h>
 #include <stdio.h>
 
 MOZ_MEMORY_API int
 vasprintf_impl(char **str, const char *fmt, va_list ap)
 {
--- a/memory/build/mozmemory_wrap.h
+++ b/memory/build/mozmemory_wrap.h
@@ -48,20 +48,21 @@
  *   specific functions are left unprefixed. All these functions are however
  *   aliased when exporting them, such that the resulting mozglue.dll exports
  *   them unprefixed (see $(topsrcdir)/mozglue/build/mozglue.def.in). The
  *   prefixed malloc implementation and duplication functions are not
  *   exported.
  *
  * - On MacOSX, the system libc has a zone allocator, which allows us to
  *   hook custom malloc implementation functions without exporting them.
- *   However, since we want things in Firefox to skip the system zone
- *   allocator, the malloc implementation functions are all exported
- *   unprefixed, as well as duplication functions.
- *   Jemalloc-specific functions are also left unprefixed.
+ *   The malloc implementation functions are all prefixed with "je_" and used
+ *   this way from the custom zone allocator. They are not exported.
+ *   Duplication functions are not included, since they will call the custom
+ *   zone allocator anyways. Jemalloc-specific functions are also left
+ *   unprefixed.
  *
  * - On Android and Gonk, all functions are left unprefixed. Additionally,
  *   C++ allocation functions (operator new/delete) are also exported and
  *   unprefixed.
  *
  * - On other systems (mostly Linux), all functions are left unprefixed.
  *
  * Only Android and Gonk add C++ allocation functions.
@@ -128,17 +129,17 @@
 #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 MOZ_EXTERN_C MFBT_API
-#    if defined(XP_WIN)
+#    if (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
 #    else
 #      define MOZ_MEMORY_API MOZ_EXTERN_C MFBT_API
 #      if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)