qsort can reuse qsort_r if available.
bsearch always passes key as the first comparator argument, so we
can use it to wrap the original comparator.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
this looks good. Too good, even. Why did not we do it before?
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h | ||
---|---|---|
573 ↗ | (On Diff #368829) | I'd rather place this logic in the .inc file - i.e. define the thread-local qsort interceptor if SANITIZER_INTERCEPT_QSORT && !SANITIZER_INTERCEPT_QSORT_R |
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | ||
---|---|---|
10012 | Wouldn't it be easier to call the qsort_r interceptor directly? | |
10018 | Let's avoid nested ifdef-else-endif-else-endif? | |
10024 | do you need a !qsort_r check here to avoid defining two interceptors for qsort? |
cleanup
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | ||
---|---|---|
10024 | it was not needed with nested ifs |
clang-tidy: error: no template named 'AddrHashMap'; did you mean '__asan::AddrHashMap'? [clang-diagnostic-error]
not useful