[PATCH] [sanitizer] Add a fast version of StackDepotGet() for use in LSan. Add a class that holds a snapshot of the StackDepot optimized for querying by ID. This allows us to speed up LSan dramatically.
Dmitry Vyukov
dvyukov at google.com
Sat Aug 24 04:05:04 PDT 2013
What performance improvement does it provide in your case?
================
Comment at: lib/sanitizer_common/sanitizer_stackdepot.h:58
@@ +57,3 @@
+
+ friend bool IdDescPairComparator(const IdDescPair &a, const IdDescPair &b);
+};
----------------
I think this should be static function in IdDescPair.
================
Comment at: lib/sanitizer_common/sanitizer_stackdepot.h:44
@@ +43,3 @@
+ StackDepotReverseMap();
+ const uptr *StackDepotGet(u32 id, uptr *size);
+
----------------
I would remove StackDepot prefix, since it's already in a class staring from StackDepot.
================
Comment at: lib/sanitizer_common/sanitizer_stackdepot.cc:225
@@ +224,3 @@
+ if (!map_.size()) return 0;
+ // Binary search.
+ uptr i_min = 0;
----------------
PLease move this into template InternalBinarySearch().
http://llvm-reviews.chandlerc.com/D1496
BRANCH
fix/stackdepot
ARCANIST PROJECT
compiler-rt
More information about the llvm-commits
mailing list