This patch adds the reentrent qsort entrypoint, qsort_r. This is done by
extending the qsort functionality and moving it to a shared utility
header. For this reason the qsort_r tests focus mostly on the places
where it differs from qsort, since they share the same sorting code.
Details
Details
- Reviewers
sivachandra lntue leonardchan jdoerfert - Commits
- rGd3074f16a6f6: [libc] Add qsort_r
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/stdlib/qsort_util.h | ||
---|---|---|
20–39 | May be Compare and CompareWithState. | |
21 | Nit: Since you are touching this anyway, you can change it to: using Compare = int(const void *, const void *); using CompareWithState = int(const void *, const void *, void *); | |
24 | All caps. Also, if you make it an enum class, then you can get scoped names like COMPARE and COMPARE_WITH_STATE. |
Nit: Since you are touching this anyway, you can change it to: