Bug 1441335 - Fix base allocator commit evaluation. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 27 Feb 2018 07:39:34 +0900
changeset 405478 4e1c789da3fc3018311a09bdf34e08a743f8905e
parent 405477 7ecadae9f269a152ebd9f2f6d0519b15644d9003
child 405479 c4425fcdfb5b3631f6eb465df9a15c61a8bd2786
push id60243
push usermh@glandium.org
push dateTue, 27 Feb 2018 04:42:18 +0000
treeherderautoland@4e1c789da3fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1441335, 515556
milestone60.0a1
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
Bug 1441335 - Fix base allocator commit evaluation. r=njn Base allocator commit stats were added in bug 515556, along other commit stats, but they have actually been wrong since then: the committed count is updated with the difference between pbase_next_addr and base_next_decommitted *after* the latter is set to the former, making the difference always 0.
memory/build/mozjemalloc.cpp
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -1439,19 +1439,19 @@ base_alloc(size_t aSize)
 
 #ifdef MALLOC_DECOMMIT
     if (!pages_commit(base_next_decommitted,
                       (uintptr_t)pbase_next_addr -
                         (uintptr_t)base_next_decommitted)) {
       return nullptr;
     }
 #endif
-    base_next_decommitted = pbase_next_addr;
     base_committed +=
       (uintptr_t)pbase_next_addr - (uintptr_t)base_next_decommitted;
+    base_next_decommitted = pbase_next_addr;
   }
 
   return ret;
 }
 
 static void*
 base_calloc(size_t aNumber, size_t aSize)
 {