History log of /openbsd-src/lib/libc/stdlib/qsort.c (Results 1 – 18 of 18)
Revision Date Author Comments
# 7d863ca8 30-May-2017 millert <millert@openbsd.org>

Don't fall back to heapsort() if we would otherwise switch to
insertion sort (when the number of elements is < 7).


# 3ea23ff6 24-May-2017 millert <millert@openbsd.org>

Support swapping 32-bit aligned elements on 64-bit platforms.
Previously they would be swapped a byte at a time when sizeof(int)
!= sizeof(long). Idea from FreeBSD.


# 4520aa4f 20-May-2017 millert <millert@openbsd.org>

Use David Musser's introsort algorithm to fall back to heapsort(3)
when the recursion depth reaches 2*lg(n + 1). This avoids quicksort's
quadratic behavior for pathological input without appreciably

Use David Musser's introsort algorithm to fall back to heapsort(3)
when the recursion depth reaches 2*lg(n + 1). This avoids quicksort's
quadratic behavior for pathological input without appreciably
changing the average run time.

show more ...


# 2c0d6f28 17-May-2017 millert <millert@openbsd.org>

The BSD qsort() performs tail recursion elimination on the second
side of the array being partitioned to save on stack space. Greater
savings can be gained by choosing recursion for the smaller side

The BSD qsort() performs tail recursion elimination on the second
side of the array being partitioned to save on stack space. Greater
savings can be gained by choosing recursion for the smaller side
of the partition and eliminating recursion for the larger side.
This also results in a small but measurable performance gain.
OK otto@ schwarze@

show more ...


# 822266ed 04-Jan-2017 millert <millert@openbsd.org>

Remove unnecessary casts of 'a' to char * since 'a' is already char *.
This is a remnant from the original 4.4BSD code that had 'a' as
void * in the function args. No binary change. OK bluhm@


# 0d943ef0 13-Sep-2015 guenther <guenther@openbsd.org>

Wrap <stdlib.h> so that calls go direct and the symbols not in the
C standard are all weak.
Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the
arch-specific __strtorx, __ULtox_D2A, __strto

Wrap <stdlib.h> so that calls go direct and the symbols not in the
C standard are all weak.
Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the
arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.

show more ...


# 1cd2179d 12-Jun-2014 millert <millert@openbsd.org>

Disable the "switch to insertion sort" optimization to avoid quadratic
behavior for certain inputs. From NetBSD. OK tedu@


# b95a9429 08-Feb-2010 otto <otto@openbsd.org>

Use size_t in appropriate places; fixes sorting of big arrays;
after the diff was written, I made it similar to the freebsd fix of
the same code; pr6287 ok millert@ guenther@


# c2c925de 08-Aug-2005 espie <espie@openbsd.org>

zap remaining rcsid.

Kill old files that are no longer compiled.

okay theo


# d8bc04e4 30-Mar-2005 pat <pat@openbsd.org>

ansi + de-register

ok otto deraadt


# 6580fee3 02-Jun-2003 millert <millert@openbsd.org>

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


# f3c3a9c6 17-Feb-2002 millert <millert@openbsd.org>

Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)


# c72b5b24 16-Feb-2002 millert <millert@openbsd.org>

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be don

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.

show more ...


# 3140f042 20-Jun-1997 deraadt <deraadt@openbsd.org>

typecastorama


# e9b2b68c 19-Aug-1996 tholo <tholo@openbsd.org>

Fix RCS ids
Make sure everything uses {SYS,}LIBC_SCCS properly


# 7964b741 25-Mar-1996 tholo <tholo@openbsd.org>

Cannot do operations on a void pointer


# d6b09060 25-Mar-1996 tholo <tholo@openbsd.org>

Add prototypes for internal functions
Change inline to __inline


# df930be7 18-Oct-1995 deraadt <deraadt@openbsd.org>

initial import of NetBSD tree