This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] "Towers of Hanoi" Mergesort Implementation
- From: Roger Sayle <roger at eyesopen dot com>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: <libc-alpha at sources dot redhat dot com>
- Date: Fri, 18 Jan 2002 00:32:05 -0700 (MST)
- Subject: Re: [PATCH] "Towers of Hanoi" Mergesort Implementation
> > 2002-01-16 Roger Sayle <roger@eyesopen.com>
> > * stdlib/msort.c (msort_with_tmp): Replace implementation with
> > more efficient "Towers of Hanoi" mergesort.
> > (hanoi_sort, hanoi_sort_int, hanoi_sort_long): New functions,
> > for generic, sizeof(int) and sizeof(long) variants respectively.
>
> This patch looks good. I've applied it now with only a few
> modifications. Besides formatting the main change was to avoid adding
> hanoi_sort_long if long has the same size as int. The compiler might
> be clever enough to eliminate the if branch but the function
> definition would remain. With a few #ifs the problem is solved.
Many Thanks.
Roger
--