Ah how ridiculously careless of me. >.< I've ran through the checklist you provided, minus the mallocs. When would it be not ok to exit upon malloc failure? I've ran through all of sort.c and it seems in all cases of memory allocation xmalloc or xnmalloc are used. Thanks!
----- Original Message ---- From: Jim Meyering <[email protected]> To: Chen Guo <[email protected]> Cc: [email protected] Sent: Sunday, October 18, 2009 11:16:18 AM Subject: Re: [PATCH] sort: Add --threads option, which parallelizes internal sort. Chen Guo wrote: > In my last patch submission I noted while sorting in LC_ALL the endline > characters of a couple of lines would be randomly cut off. The cause was > memcoll being not threadsafe, I've since included a workaround. .... > + /* If singlethreaded, the merge uses the memory optimization > + suggested in Knuth exercise 5.2.4-10; see sortlines. */ > + size_t bytes_per_line = 3*sizeof (struct line); > + - (1 < nthreads ? 0 : sizeof (struct line)*3/2); I nearly forgot to point out the above. There's a stray semicolon.
