Bug 1137580 - Do not use system realloc in mozjemalloc-exposed _recalloc. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 07 Aug 2015 16:20:15 +0900
changeset 288465 3d180b8dcf42562916e112c55e771c505f4d2f3f
parent 288464 4a62230eaed4b52e09e53fba5280162f6f51f609
child 288466 ce43b991306ff30a8f3c62430fd285e7b69a131c
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1137580
milestone42.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 1137580 - Do not use system realloc in mozjemalloc-exposed _recalloc. r=njn
memory/mozjemalloc/jemalloc.c
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -6777,17 +6777,17 @@ void*
 	/*
 	 * In order for all trailing bytes to be zeroed, the caller needs to
 	 * use calloc(), followed by recalloc().  However, the current calloc()
 	 * implementation only zeros the bytes requested, so if recalloc() is
 	 * to work 100% correctly, calloc() will need to change to zero
 	 * trailing bytes.
 	 */
 
-	ptr = realloc(ptr, newsize);
+	ptr = realloc_impl(ptr, newsize);
 	if (ptr != NULL && oldsize < newsize) {
 		memset((void *)((uintptr_t)ptr + oldsize), 0, newsize -
 		    oldsize);
 	}
 
 	return ptr;
 }