Bug 1137580 - Do not use system realloc in mozjemalloc-exposed _recalloc. r=njn, a=sledru
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 07 Aug 2015 00:23:00 +0200
changeset 281820 cc225ace7557b25293adbdc1d4794331bf25ffea
parent 281819 b829e2ecf999e55d05e17d5976362a7dd0016125
child 281821 b34e72849f78f717e2c92e28582ebaa844c9d9a8
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn, sledru
bugs1137580
milestone41.0a2
Bug 1137580 - Do not use system realloc in mozjemalloc-exposed _recalloc. r=njn, a=sledru
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;
 }