summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2010-08-04 16:10:10 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2010-08-04 16:10:59 -0700
commit2b49b140cc13cf36ec5ee5acaca5ac7bfeed6366 (patch)
treef527d9cdeae11387f80ee5ea81b3bfe869c55e8d /m4
parentdb48b362417e3f86671c040610ddfa27596bd258 (diff)
downloadcoreutils-2b49b140cc13cf36ec5ee5acaca5ac7bfeed6366.tar.xz
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.
Diffstat (limited to 'm4')
-rw-r--r--m4/memxfrm.m415
-rw-r--r--m4/prereq.m43
2 files changed, 1 insertions, 17 deletions
diff --git a/m4/memxfrm.m4 b/m4/memxfrm.m4
deleted file mode 100644
index 47a17d3bf..000000000
--- a/m4/memxfrm.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_MEMXFRM],
-[
- AC_LIBSOURCES([memxfrm.c, memxfrm.h])
- AC_LIBOBJ([memxfrm])
-
- AC_REQUIRE([AC_C_RESTRICT])
-
- dnl Prerequisites of lib/memcoll.c.
- AC_CHECK_FUNCS_ONCE([strxfrm])
-])
diff --git a/m4/prereq.m4 b/m4/prereq.m4
index 24478cb82..8caea38cf 100644
--- a/m4/prereq.m4
+++ b/m4/prereq.m4
@@ -1,4 +1,4 @@
-#serial 76
+#serial 77
dnl We use gl_ for non Autoconf macros.
m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
@@ -40,7 +40,6 @@ AC_DEFUN([gl_PREREQ],
AC_REQUIRE([gl_FD_REOPEN])
AC_REQUIRE([gl_FUNC_XATTR])
AC_REQUIRE([gl_FUNC_XFTS])
- AC_REQUIRE([gl_MEMXFRM])
AC_REQUIRE([gl_STRINTCMP])
AC_REQUIRE([gl_STRNUMCMP])
])