<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/stdlib/qsort.c, branch release/11.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r318514-r318515, r318517, r318917</title>
<updated>2017-05-31T05:52:32+00:00</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2017-05-31T05:52:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c2abfab50950ea781d011106ab804e29a1ea5d60'/>
<id>c2abfab50950ea781d011106ab804e29a1ea5d60</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Use ANSI C prototypes.  Eliminates -Wold-style-definition warnings.</title>
<updated>2015-09-20T20:24:28+00:00</updated>
<author>
<name>Craig Rodrigues</name>
<email>rodrigc@FreeBSD.org</email>
</author>
<published>2015-09-20T20:24:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f98e0c9dd831748338a7856c0e98678ea8181d19'/>
<id>f98e0c9dd831748338a7856c0e98678ea8181d19</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>qsort(3): small style(9) cleanups.</title>
<updated>2015-03-05T17:17:11+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-03-05T17:17:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2eaea119b836b317143216ca21a3a87a987175a5'/>
<id>2eaea119b836b317143216ca21a3a87a987175a5</id>
<content type='text'>
Basically spaces vs. tabs.
No functional change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Basically spaces vs. tabs.
No functional change.
</pre>
</div>
</content>
</entry>
<entry>
<title>qsort(3): enhance to handle 32-bit aligned data on 64-bit systems</title>
<updated>2015-03-05T17:00:39+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-03-05T17:00:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9382fabf1f68297c14b37fbec3614c0c94274524'/>
<id>9382fabf1f68297c14b37fbec3614c0c94274524</id>
<content type='text'>
Implement a small enhancement to the original qsort implementation:
If the data is 32 bit aligned we can side-step the long type
version and use int instead.

The change brings a modest but significant improvement in
32 bit workloads.

Relnotes:	yes

PR:		135718
Taken from:	ache
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement a small enhancement to the original qsort implementation:
If the data is 32 bit aligned we can side-step the long type
version and use int instead.

The change brings a modest but significant improvement in
32 bit workloads.

Relnotes:	yes

PR:		135718
Taken from:	ache
</pre>
</div>
</content>
</entry>
<entry>
<title>Renumber clauses to reduce diffs to other versions</title>
<updated>2013-06-13T00:19:30+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2013-06-13T00:19:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=580b4d185bc1d20da91429229920ce590309cbf6'/>
<id>580b4d185bc1d20da91429229920ce590309cbf6</id>
<content type='text'>
NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.
</pre>
</div>
</content>
</entry>
<entry>
<title>Changing 'r' to a size_t in the previous commit turned quicksort</title>
<updated>2008-01-14T09:21:34+00:00</updated>
<author>
<name>David Schultz</name>
<email>das@FreeBSD.org</email>
</author>
<published>2008-01-14T09:21:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ac48ad2e5e553248a7a5991659a68ecdcacf8ef3'/>
<id>ac48ad2e5e553248a7a5991659a68ecdcacf8ef3</id>
<content type='text'>
into slowsort for some sequences because different parts of the
code used 'r' to store two different things, one of which was
signed. Clean things up by splitting 'r' into two variables, and
use a more meaningful name.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
into slowsort for some sequences because different parts of the
code used 'r' to store two different things, one of which was
signed. Clean things up by splitting 'r' into two variables, and
use a more meaningful name.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use size_t to avoid overflow when sorting arrays larger than 2 GB.</title>
<updated>2008-01-13T02:11:10+00:00</updated>
<author>
<name>David Schultz</name>
<email>das@FreeBSD.org</email>
</author>
<published>2008-01-13T02:11:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=badf97cd559de5bb2e86e9f37652c3c1eccf3cbe'/>
<id>badf97cd559de5bb2e86e9f37652c3c1eccf3cbe</id>
<content type='text'>
PR:		111085
MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR:		111085
MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>Per Regents of the University of Calfornia letter, remove advertising</title>
<updated>2007-01-09T00:28:16+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2007-01-09T00:28:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c879ae3536e6d92b8d96c8965c5b05fcb9541520'/>
<id>c879ae3536e6d92b8d96c8965c5b05fcb9541520</id>
<content type='text'>
clause.

# If I've done so improperly on a file, please let me know.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clause.

# If I've done so improperly on a file, please let me know.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement C99's _Exit() interface.</title>
<updated>2002-09-10T02:04:49+00:00</updated>
<author>
<name>Garrett Wollman</name>
<email>wollman@FreeBSD.org</email>
</author>
<published>2002-09-10T02:04:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=eca67d510483ad9565b7b816e16fc72ebe3b2864'/>
<id>eca67d510483ad9565b7b816e16fc72ebe3b2864</id>
<content type='text'>
Implement a version of qsort that provides a thunk to the comparison function.

Update manual pages.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement a version of qsort that provides a thunk to the comparison function.

Update manual pages.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix the style of the SCM ID's.</title>
<updated>2002-03-22T21:53:29+00:00</updated>
<author>
<name>David E. O'Brien</name>
<email>obrien@FreeBSD.org</email>
</author>
<published>2002-03-22T21:53:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=333fc21e3cd79bca0c94d7722c5a56cb5ad078d1'/>
<id>333fc21e3cd79bca0c94d7722c5a56cb5ad078d1</id>
<content type='text'>
I believe have made all of libc .c's as consistent as possible.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I believe have made all of libc .c's as consistent as possible.
</pre>
</div>
</content>
</entry>
</feed>
