This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]