tsan: reduce internal allocator region from 16M to 1M
authorDmitry Vyukov <dvyukov@google.com>
Sat, 26 Jul 2014 10:17:26 +0000 (10:17 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Sat, 26 Jul 2014 10:17:26 +0000 (10:17 +0000)
16M regions can waste almost 1G for nothing.
Since region size is used only during initial heap growth,
it's unclear why we even need such huge regions.

llvm-svn: 214027

compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h

index bc81933..005a010 100644 (file)
@@ -25,13 +25,12 @@ typedef CompactSizeClassMap InternalSizeClassMap;
 
 static const uptr kInternalAllocatorSpace = 0;
 static const u64 kInternalAllocatorSize = SANITIZER_MMAP_RANGE_SIZE;
-#if SANITIZER_WORDSIZE == 32
 static const uptr kInternalAllocatorRegionSizeLog = 20;
+#if SANITIZER_WORDSIZE == 32
 static const uptr kInternalAllocatorNumRegions =
     kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog;
 typedef FlatByteMap<kInternalAllocatorNumRegions> ByteMap;
 #else
-static const uptr kInternalAllocatorRegionSizeLog = 24;
 static const uptr kInternalAllocatorNumRegions =
     kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog;
 typedef TwoLevelByteMap<(kInternalAllocatorNumRegions >> 12), 1 << 12> ByteMap;