[compiler-rt] r177270 - [asan] make the __asan_get_heap_size more robust

Kostya Serebryany kcc at google.com
Mon Mar 18 03:52:25 PDT 2013


Author: kcc
Date: Mon Mar 18 05:52:25 2013
New Revision: 177270

URL: http://llvm.org/viewvc/llvm-project?rev=177270&view=rev
Log:
[asan] make the __asan_get_heap_size more robust

Modified:
    compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc

Modified: compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc?rev=177270&r1=177269&r2=177270&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc Mon Mar 18 05:52:25 2013
@@ -464,6 +464,7 @@ TEST(AddressSanitizerInterface, GetHeapS
   // The chunk should be greater than the quarantine size,
   // otherwise it will be stuck in quarantine instead of being unmaped.
   static const size_t kLargeMallocSize = (1 << 28) + 1;  // 256M
+  free(Ident(malloc(kLargeMallocSize)));  // Drain quarantine.
   uptr old_heap_size = __asan_get_heap_size();
   for (int i = 0; i < 3; i++) {
     // fprintf(stderr, "allocating %zu bytes:\n", kLargeMallocSize);





More information about the llvm-commits mailing list