Bug 1181142 - Part 1: Make the minimum allocation size word sized on all platforms. r=glandium
authorEric Rahm <erahm@mozilla.com>
Tue, 07 Jul 2015 17:36:31 -0700
changeset 290863 45c01e7fbe3fb034e0a2b5bfb6a6a745b19497ff
parent 290862 77b78203d8b153d16708b6488f30f131bbe8c8f0
child 290864 0a14d675236ec1f37d1251b7e9ea5f9aa2aea35e
push id74398
push usererahm@mozilla.com
push dateWed, 30 Mar 2016 07:02:05 +0000
treeherdermozilla-inbound@0a14d675236e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1181142, 691003
milestone48.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 1181142 - Part 1: Make the minimum allocation size word sized on all platforms. r=glandium Bug 691003 made the minimum allocation size word sized for Linux and OS X, we now need to do a similar change on Windows as well. For Windows the requirement is 8-bytes on 32-bit and 16-bytes on 64-bit.
memory/mozjemalloc/jemalloc.c
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -542,21 +542,22 @@ static const bool isthreaded = true;
  * Maximum size of L1 cache line.  This is used to avoid cache line aliasing,
  * so over-estimates are okay (up to a point), but under-estimates will
  * negatively affect performance.
  */
 #define	CACHELINE_2POW		6
 #define	CACHELINE		((size_t)(1U << CACHELINE_2POW))
 
 /*
- * Smallest size class to support.  On Linux and Mac, even malloc(1) must
- * reserve a word's worth of memory (see Mozilla bug 691003).
+ * Smallest size class to support.  On Windows the smallest allocation size
+ * must be 8 bytes on 32-bit, 16 bytes on 64-bit.  On Linux and Mac, even
+ * malloc(1) must reserve a word's worth of memory (see Mozilla bug 691003).
  */
 #ifdef MOZ_MEMORY_WINDOWS
-#define	TINY_MIN_2POW		1
+#define TINY_MIN_2POW           (sizeof(void*) == 8 ? 4 : 3)
 #else
 #define TINY_MIN_2POW           (sizeof(void*) == 8 ? 3 : 2)
 #endif
 
 /*
  * Maximum size class that is a multiple of the quantum, but not (necessarily)
  * a power of 2.  Above this size, allocations are rounded up to the nearest
  * power of 2.