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 291040 45c01e7fbe3fb034e0a2b5bfb6a6a745b19497ff
parent 291039 77b78203d8b153d16708b6488f30f131bbe8c8f0
child 291041 0a14d675236ec1f37d1251b7e9ea5f9aa2aea35e
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1181142, 691003
milestone48.0a1
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.