From 181f504d822f968bc851e926b1135f3a10b8e12d Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Tue, 25 Dec 2012 07:17:17 +0000 Subject: [PATCH] [asan] properly define ASAN_LOW_MEMORY. Due to a mistake it has been always true causing redzone and quarantine sizes to be smaller than it was some time before (and out of sync with the documentation). Also make one test less greedy llvm-svn: 171052 --- compiler-rt/lib/asan/asan_internal.h | 4 ++-- compiler-rt/lib/asan/tests/asan_noinst_test.cc | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler-rt/lib/asan/asan_internal.h b/compiler-rt/lib/asan/asan_internal.h index 468d997cf262..03f0890fc02f 100644 --- a/compiler-rt/lib/asan/asan_internal.h +++ b/compiler-rt/lib/asan/asan_internal.h @@ -83,9 +83,9 @@ // If set, values like allocator chunk size, as well as defaults for some flags // will be changed towards less memory overhead. #ifndef ASAN_LOW_MEMORY -# ifdef ASAN_ANDROID +#if SANITIZER_WORDSIZE == 32 # define ASAN_LOW_MEMORY 1 -# else +#else # define ASAN_LOW_MEMORY 0 # endif #endif diff --git a/compiler-rt/lib/asan/tests/asan_noinst_test.cc b/compiler-rt/lib/asan/tests/asan_noinst_test.cc index 575dfd230025..018e559c3ae3 100644 --- a/compiler-rt/lib/asan/tests/asan_noinst_test.cc +++ b/compiler-rt/lib/asan/tests/asan_noinst_test.cc @@ -508,7 +508,7 @@ TEST(AddressSanitizerInterface, GetFreeBytesTest) { EXPECT_DEATH(DoLargeMallocForGetFreeBytesTestAndDie(), "double-free"); } -static const size_t kManyThreadsMallocSizes[] = {5, 1UL<<10, 1UL<<20, 357}; +static const size_t kManyThreadsMallocSizes[] = {5, 1UL<<10, 1UL<<14, 357}; static const size_t kManyThreadsIterations = 250; static const size_t kManyThreadsNumThreads = (SANITIZER_WORDSIZE == 32) ? 40 : 200; @@ -520,6 +520,8 @@ void *ManyThreadsWithStatsWorker(void *arg) { free(Ident(malloc(kManyThreadsMallocSizes[size_index]))); } } + // Just one large allocation. + free(Ident(malloc(1 << 20))); return 0; }