From 4baa65518be9c287a869bf5daf7eaf7e7a768a3b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 26 Jul 2014 10:17:26 +0000 Subject: [PATCH] tsan: reduce internal allocator region from 16M to 1M 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h index bc81933..005a010 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h @@ -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 ByteMap; #else -static const uptr kInternalAllocatorRegionSizeLog = 24; static const uptr kInternalAllocatorNumRegions = kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog; typedef TwoLevelByteMap<(kInternalAllocatorNumRegions >> 12), 1 << 12> ByteMap; -- 2.7.4