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 | 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 | ||
---|---|---|
9952 | do you need a !qsort_r check here to avoid defining two interceptors for qsort? | |
9953 | Wouldn't it be easier to call the qsort_r interceptor directly? | |
9955 | Let's avoid nested ifdef-else-endif-else-endif? |
cleanup
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | ||
---|---|---|
9952 | it was not needed with nested ifs |
clang-tidy: error: no template named 'AddrHashMap'; did you mean '__asan::AddrHashMap'? [clang-diagnostic-error]
not useful