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: Ulrich Drepper <drepper at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: <libc-alpha at sources dot redhat dot com>
- Date: 17 Jan 2002 22:25:14 -0800
- Subject: Re: [PATCH] "Towers of Hanoi" Mergesort Implementation
- References: <Pine.LNX.4.33.0201161628330.29274-100000@www.eyesopen.com>
- Reply-to: drepper at redhat dot com (Ulrich Drepper)
Roger Sayle <roger@eyesopen.com> writes:
> 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.
Thanks,
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------