bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifiable NMERGE in sort


From: Bo Borgerson
Subject: Re: Modifiable NMERGE in sort
Date: Mon, 31 Mar 2008 09:46:06 -0400

On Mon, Mar 31, 2008 at 2:29 AM, Paul Eggert <address@hidden> wrote:
 > Alas, that patch assumes C99, and we can't assume that quite yet.
 >  Also, it mishandles nmerge values that are "too large" (you'll get
 >  core dumps or worse on many hosts).  That being said, it might be
 >  worth adding an option like that (it's a bit specialized, but it's a
 >  big performance win in some cases).
 >

 Ah, yes I see.  Thanks for the feedback.  Please allow me to take
 another stab at this.

 For the first issue: I've replaced the variable-length arrays in
 mergefps with pointers xnmalloc'd storage.

 For the second: I've introduced a small dedicated function for
 validating and applying changes to nmerge.  In addition to checking
 bounds I also added a check for sort_size to ensure that it's still at
 least MIN_SORT_SIZE after an nmerge adjustment.

 Thanks again,

 Bo

Attachment: sort.c.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]