summaryrefslogtreecommitdiffstats
path: root/sys/libkern/qsort.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r318514-r318515, r318517, r318917delphij2017-05-311-47/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r318514: Use size_t. Inspired by: OpenBSD src/lib/libc/stdlib/qsort.c,v 1.11 r318515: The current qsort(3) implementation ignores the sizes of partitions, and always perform recursion on the left partition, then use a tail call to handle the right partition. In the worst case this could require O(N) levels of recursions. Reduce the possible recursion level to log2(N) by always recursing on the smaller partition instead. Obtained from: PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096 r318517: Sync qsort.c with userland r318515. (Note that MIN macro is removed in favor of sys/param.h's version). PR: 213922 r318917: Disconnect heimdal version of qsort.c from build because we are already using libc's version of qsort. PR: bin/213922
* MFC r311989 (cem):delphij2017-05-311-3/+3
| | | | libkern: Remove obsolete 'register' keyword
* Copy qsort_r(3) from libc to libkern.glebius2004-07-151-24/+41
| | | | | Reviewed by: phk Approved by: julian (mentor)
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Fix instances of macros with improperly parenthasized arguments.alfred2002-11-091-1/+1
| | | | Verified by: md5
* Remove __P.alfred2002-03-201-3/+3
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* #include sys/libkern.h instead of stdlib.h.phk1998-06-301-2/+2
| | | | | | PR: 7105 Reviewed by: phk Submitted by: Robert Watson <robert+freebsd@cyrus.watson.org>
* Support compiling with `gcc -ansi'.bde1998-04-151-5/+5
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Don't depend in the kernel on the gcc feature of doing arithmetic onbde1996-08-311-10/+10
| | | | pointers of type `void *'. Warn about this in future.
* Removed sccsids and rcsids and added Id$ to save space like everythingbde1996-08-281-8/+2
| | | | else in libkern.
* Don't include <sys/types.h> when it isn't used.bde1996-04-191-2/+1
| | | | | This commit covers most of the ANSI library functions. Many others only need <sys/types.h> because they use u_xxx.
* Added prototypes.bde1995-12-261-3/+9
|
* Add qsort() to libkern, taken from libc.phk1995-11-081-0/+173
OpenPOWER on IntegriCloud