[compiler-rt] r214027 - tsan: reduce internal allocator region from 16M to 1M

Dmitry Vyukov dvyukov at google.com
Sat Jul 26 03:17:26 PDT 2014


Author: dvyukov
Date: Sat Jul 26 05:17:26 2014
New Revision: 214027

URL: http://llvm.org/viewvc/llvm-project?rev=214027&view=rev
Log:
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.


Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_internal.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_internal.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_internal.h?rev=214027&r1=214026&r2=214027&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_internal.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_internal.h Sat Jul 26 05:17:26 2014
@@ -25,13 +25,12 @@ typedef CompactSizeClassMap InternalSize
 
 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;





More information about the llvm-commits mailing list