[llvm-commits] [compiler-rt] r172215 - /compiler-rt/trunk/lib/sanitizer_common/sanitizer_quarantine.h
Dmitry Vyukov
dvyukov at google.com
Fri Jan 11 08:40:02 PST 2013
Author: dvyukov
Date: Fri Jan 11 10:40:01 2013
New Revision: 172215
URL: http://llvm.org/viewvc/llvm-project?rev=172215&view=rev
Log:
asan: add memory prefetch to quarantine recycle
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_quarantine.h
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_quarantine.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_quarantine.h?rev=172215&r1=172214&r2=172215&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_quarantine.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_quarantine.h Fri Jan 11 10:40:01 2013
@@ -89,9 +89,18 @@
}
}
recycle_mutex_.Unlock();
- while (QuarantineBatch *b = tmp.DequeueBatch()) {
- for (uptr i = 0; i < b->count; i++)
+ DoRecycle(&tmp, cb);
+ }
+
+ void NOINLINE DoRecycle(Cache *c, Callback cb) {
+ while (QuarantineBatch *b = c->DequeueBatch()) {
+ const uptr kPrefetch = 16;
+ for (uptr i = 0; i < kPrefetch; i++)
+ PREFETCH(b->batch[i]);
+ for (uptr i = 0; i < b->count; i++) {
+ PREFETCH(b->batch[i + kPrefetch]);
cb.Recycle((Node*)b->batch[i]);
+ }
cb.Deallocate(b);
}
}
More information about the llvm-commits
mailing list