Backed out changeset 14dac365b5f6 (bug 1402174) for frequently asserting rbp_i_cmp > 0, at mozjemalloc.cpp:2381. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 22 Sep 2017 16:48:08 +0200
changeset 382450 c298db9e14fb60576b38398db72b4f77ed2a5307
parent 382449 59fe562e84ff70658a0627866240923ae990fd96
child 382451 6c69f8021a5e4eee44ec3ce78e46d1cd49fc6277
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)
reviewersbackout
bugs1402174
milestone58.0a1
backs out14dac365b5f6e32b3caab3ab4bd2a75856374c72
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
Backed out changeset 14dac365b5f6 (bug 1402174) for frequently asserting rbp_i_cmp > 0, at mozjemalloc.cpp:2381. r=backout
memory/build/mozjemalloc.cpp
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -4718,16 +4718,75 @@ MozJemalloc::memalign(size_t aAlignment,
   }
 
   aAlignment = aAlignment < sizeof(void*) ? sizeof(void*) : aAlignment;
   ret = ipalloc(aAlignment, aSize);
 
   return ret;
 }
 
+template<void* (*memalign)(size_t, size_t)>
+struct AlignedAllocator
+{
+  static inline int
+  posix_memalign(void** aMemPtr, size_t aAlignment, size_t aSize)
+  {
+    void* result;
+
+    /* alignment must be a power of two and a multiple of sizeof(void*) */
+    if (((aAlignment - 1) & aAlignment) != 0 || aAlignment < sizeof(void*)) {
+      return EINVAL;
+    }
+
+    /* The 0-->1 size promotion is done in the memalign() call below */
+
+    result = memalign(aAlignment, aSize);
+
+    if (!result) {
+      return ENOMEM;
+    }
+
+    *aMemPtr = result;
+    return 0;
+  }
+
+  static inline void*
+  aligned_alloc(size_t aAlignment, size_t aSize)
+  {
+    if (aSize % aAlignment) {
+      return nullptr;
+    }
+    return memalign(aAlignment, aSize);
+  }
+
+  static inline void*
+  valloc(size_t aSize)
+  {
+    return memalign(GetKernelPageSize(), aSize);
+  }
+};
+
+template<> inline int
+MozJemalloc::posix_memalign(void** aMemPtr, size_t aAlignment, size_t aSize)
+{
+  return AlignedAllocator<memalign>::posix_memalign(aMemPtr, aAlignment, aSize);
+}
+
+template<> inline void*
+MozJemalloc::aligned_alloc(size_t aAlignment, size_t aSize)
+{
+  return AlignedAllocator<memalign>::aligned_alloc(aAlignment, aSize);
+}
+
+template<> inline void*
+MozJemalloc::valloc(size_t aSize)
+{
+  return AlignedAllocator<memalign>::valloc(aSize);
+}
+
 template<> inline void*
 MozJemalloc::calloc(size_t aNum, size_t aSize)
 {
   void *ret;
   size_t num_size;
 
   if (malloc_init()) {
     num_size = 0;
@@ -4805,75 +4864,16 @@ MozJemalloc::free(void* aPtr)
   offset = CHUNK_ADDR2OFFSET(aPtr);
   if (offset != 0) {
     arena_dalloc(aPtr, offset);
   } else if (aPtr) {
     huge_dalloc(aPtr);
   }
 }
 
-template<void* (*memalign)(size_t, size_t)>
-struct AlignedAllocator
-{
-  static inline int
-  posix_memalign(void** aMemPtr, size_t aAlignment, size_t aSize)
-  {
-    void* result;
-
-    /* alignment must be a power of two and a multiple of sizeof(void*) */
-    if (((aAlignment - 1) & aAlignment) != 0 || aAlignment < sizeof(void*)) {
-      return EINVAL;
-    }
-
-    /* The 0-->1 size promotion is done in the memalign() call below */
-
-    result = memalign(aAlignment, aSize);
-
-    if (!result) {
-      return ENOMEM;
-    }
-
-    *aMemPtr = result;
-    return 0;
-  }
-
-  static inline void*
-  aligned_alloc(size_t aAlignment, size_t aSize)
-  {
-    if (aSize % aAlignment) {
-      return nullptr;
-    }
-    return memalign(aAlignment, aSize);
-  }
-
-  static inline void*
-  valloc(size_t aSize)
-  {
-    return memalign(GetKernelPageSize(), aSize);
-  }
-};
-
-template<> inline int
-MozJemalloc::posix_memalign(void** aMemPtr, size_t aAlignment, size_t aSize)
-{
-  return AlignedAllocator<memalign>::posix_memalign(aMemPtr, aAlignment, aSize);
-}
-
-template<> inline void*
-MozJemalloc::aligned_alloc(size_t aAlignment, size_t aSize)
-{
-  return AlignedAllocator<memalign>::aligned_alloc(aAlignment, aSize);
-}
-
-template<> inline void*
-MozJemalloc::valloc(size_t aSize)
-{
-  return AlignedAllocator<memalign>::valloc(aSize);
-}
-
 /*
  * End malloc(3)-compatible functions.
  */
 /******************************************************************************/
 /*
  * Begin non-standard functions.
  */