sort: -R now uses less memory on long lines with internal NULs
commit2b49b140cc13cf36ec5ee5acaca5ac7bfeed6366
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Aug 2010 23:10:10 +0000 (4 16:10 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Aug 2010 23:10:59 +0000 (4 16:10 -0700)
treef527d9cdeae11387f80ee5ea81b3bfe869c55e8d
parentdb48b362417e3f86671c040610ddfa27596bd258
sort: -R now uses less memory on long lines with internal NULs

* lib/Makefile.am (libcoreutils_a_SOURCES): Remove xmemxfrm.c,
xmemxfrm.h.
* lib/memxfrm.c, lib/memxfrm.h, lib/xmemxfrm.c, lib/xmemxfrm.h: Remove.
* m4/memxfrm.m4: Likewise.
* m4/prereq.m4 (gl_PREREQ): Remove gl_MEMXFRM.
* po/POTFILES.in: Remove lib/xmemxfrm.c.
* src/sort.c: Don't include xmemxfrm.h.
(cmp_hashes): Remove.
(xstrxfrm): New function.
(compare_random): If a line contains NULs, don't create a big
buffer that contains the strxfrm output of each string in the line.
Instead, accumulate checksums and differences as we go, so that
at any one time we have to store at most the output of a single
strxfrm call when processing the line.  This removes the need for
an memxfrm function.
lib/Makefile.am
lib/memxfrm.c [deleted file]
lib/memxfrm.h [deleted file]
lib/xmemxfrm.c [deleted file]
lib/xmemxfrm.h [deleted file]
m4/memxfrm.m4 [deleted file]
m4/prereq.m4
po/POTFILES.in
src/sort.c