Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 1999 11:05:09 +0200 (CEST)
From:      Nick Hibma <n_hibma@skylink.it>
To:        Archie Cobbs <archie@whistle.com>
Cc:        Christopher Seiwald <seiwald@perforce.com>, a-wada@mars.dti.ne.jp, freebsd-hackers@FreeBSD.ORG
Subject:   Re: anybody love qsort.c?
Message-ID:  <Pine.BSF.4.10.9908211101130.7595-100000@heidi.plazza.it>
In-Reply-To: <199908210135.SAA48009@bubba.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9908211101130.7595-100000>