From 10548681c05db944e730e20137996e847e887061 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 24 Nov 2013 14:28:18 +0000 Subject: [PATCH] [lsan] Use real memset to clear memory in standalone LSan. Performance improvement. Also, the allocator was using CompactSizeClassMap for no good reason, so I switched it to DefaultSizeClassMap. llvm-svn: 195570 --- compiler-rt/lib/lsan/lsan_allocator.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/lsan/lsan_allocator.cc b/compiler-rt/lib/lsan/lsan_allocator.cc index 1512c2e85f25..f7eee1314bf0 100644 --- a/compiler-rt/lib/lsan/lsan_allocator.cc +++ b/compiler-rt/lib/lsan/lsan_allocator.cc @@ -20,6 +20,8 @@ #include "sanitizer_common/sanitizer_stacktrace.h" #include "lsan_common.h" +extern "C" void *memset(void *ptr, int value, uptr num); + namespace __lsan { static const uptr kMaxAllowedMallocSize = 8UL << 30; @@ -34,7 +36,7 @@ struct ChunkMetadata { }; typedef SizeClassAllocator64 PrimaryAllocator; + sizeof(ChunkMetadata), DefaultSizeClassMap> PrimaryAllocator; typedef SizeClassAllocatorLocalCache AllocatorCache; typedef LargeMmapAllocator<> SecondaryAllocator; typedef CombinedAllocator