[PATCH] D28061: Improve ThreadedQuarantineTest heap memory measurements.

Evgeniy Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 13:26:32 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL290371: Improve ThreadedQuarantineTest heap memory measurements. (authored by eugenis).

Changed prior to commit:
  https://reviews.llvm.org/D28061?vs=82349&id=82366#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28061

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


Index: compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
===================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
+++ compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
@@ -170,15 +170,21 @@
 // Check that the thread local allocators are flushed when threads are
 // destroyed.
 TEST(AddressSanitizer, ThreadedQuarantineTest) {
+  // Run the routine once to warm up ASAN internal structures to get more
+  // predictable incremental memory changes.
+  pthread_t t;
+  PTHREAD_CREATE(&t, NULL, ThreadedQuarantineTestWorker, 0);
+  PTHREAD_JOIN(t, 0);
+
   const int n_threads = 3000;
   size_t mmaped1 = __sanitizer_get_heap_size();
   for (int i = 0; i < n_threads; i++) {
     pthread_t t;
     PTHREAD_CREATE(&t, NULL, ThreadedQuarantineTestWorker, 0);
     PTHREAD_JOIN(t, 0);
     size_t mmaped2 = __sanitizer_get_heap_size();
     // Figure out why this much memory is required.
-    EXPECT_LT(mmaped2 - mmaped1, 352U * (1 << 20));
+    EXPECT_LT(mmaped2 - mmaped1, 320U * (1 << 20));
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28061.82366.patch
Type: text/x-patch
Size: 1073 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161222/38a64b2f/attachment.bin>


More information about the llvm-commits mailing list