From owner-freebsd-hackers Sat Aug 21 2:13:16 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from ns.skylink.it (ns.skylink.it [194.177.113.1]) by hub.freebsd.org (Postfix) with ESMTP id EF1E814EBE for ; Sat, 21 Aug 1999 02:13:08 -0700 (PDT) (envelope-from n_hibma@skylink.it) Received: from heidi.plazza.it (va-145.skylink.it [194.185.55.145]) by ns.skylink.it (8.9.1/8.8.8) with ESMTP id LAA24869; Sat, 21 Aug 1999 11:11:18 +0200 Received: from localhost (localhost [127.0.0.1]) by heidi.plazza.it (8.9.3/8.8.5) with ESMTP id LAA17434; Sat, 21 Aug 1999 11:05:09 +0200 (CEST) Date: Sat, 21 Aug 1999 11:05:09 +0200 (CEST) From: Nick Hibma X-Sender: n_hibma@heidi.plazza.it Reply-To: Nick Hibma To: Archie Cobbs Cc: Christopher Seiwald , a-wada@mars.dti.ne.jp, freebsd-hackers@FreeBSD.ORG Subject: Re: anybody love qsort.c? In-Reply-To: <199908210135.SAA48009@bubba.whistle.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You can check the change by recompiling a few utils with the change: (find . -name \*.c | xargs grep -l qsort) ./bin/ps/ps.c ./contrib/gcc/*.c ./contrib/top/commands.c ./games/fortune/strfile/strfile.c ./gnu/usr.bin/sort/sort.c ./sbin/fsck/pass2.c The fsck one is a nice one. Just wack your /usr and reboot :-) Nick On Fri, 20 Aug 1999, Archie Cobbs wrote: > Christopher Seiwald writes: > > But as I'm proposing a change to a fairly sensitive piece of code, I'd > > like to keep the change as modest as possible. > > How about this? > > Index: qsort.c > =================================================================== > RCS file: /home/ncvs/src/lib/libc/stdlib/qsort.c,v > retrieving revision 1.7 > diff -u -r1.7 qsort.c > --- qsort.c 1997/02/22 15:03:14 1.7 > +++ qsort.c 1999/08/21 01:35:35 > @@ -153,7 +153,7 @@ > pb += es; > pc -= es; > } > - if (swap_cnt == 0) { /* Switch to insertion sort */ > + if (n <= 32 && swap_cnt == 0) { /* Switch to insertion sort */ > for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) > for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0; > pl -= es) > > > -Archie > > ___________________________________________________________________________ > Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > > -- e-Mail: hibma@skylink.it To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message