diff options
author | Érico Nogueira <ericonr@disroot.org> | 2021-03-09 18:02:13 -0300 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2021-09-23 20:09:22 -0400 |
commit | b76f37fd5625d038141b52184956fb4b7838e9a5 (patch) | |
tree | 8375a3587dcf9c921cedb4858f4c6d2400f909cd /src/stdlib/bsearch.c | |
parent | 7be59733d71ada3a32a98622507399253f1d5e48 (diff) | |
download | musl-b76f37fd5625d038141b52184956fb4b7838e9a5.tar.gz musl-b76f37fd5625d038141b52184956fb4b7838e9a5.tar.bz2 musl-b76f37fd5625d038141b52184956fb4b7838e9a5.tar.xz musl-b76f37fd5625d038141b52184956fb4b7838e9a5.zip |
add qsort_r and make qsort a wrapper around it
we make qsort a wrapper by providing a wrapper_cmp function that uses
the extra argument as a function pointer. should be optimized to a tail
call on most architectures, as long as it's built with
-fomit-frame-pointer, so the performance impact should be minimal.
to keep the git history clean, for now qsort_r is implemented in qsort.c
and qsort is implemented in qsort_nr.c. qsort.c also received a few
trivial cleanups, including replacing (*cmp)() calls with cmp().
qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
itself.
Diffstat (limited to 'src/stdlib/bsearch.c')
0 files changed, 0 insertions, 0 deletions