From 3ece0355d52e41a1b079c0c46477a32250278c11 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 19 Nov 2008 19:36:45 +0100 Subject: cp: use far less memory in some cases cp --link was "remembering" many name,dev,inode triples unnecessarily. cp was doing the same, even without --link, for every directory in the source hierarchy, while it can do its job with entries merely for the command-line arguments. Prompted by a report from Patrick Shoenfeld. Details . * src/copy.c (copy_internal): Refrain from remembering name,dev,inode for most files, when invoked via cp --link. Record an infloop-avoidance triple for each directory specified on the command line, not for each directory in the source tree. Don't record a dir-triple when x->hard_link is set. * NEWS (Buf fixes): Mention it. * tests/cp/link-heap: New file. Test for cp's lowered memory usage. * tests/Makefile.am (TESTS): Add link-heap. --- tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index e955d9b77..f264bd0c6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -262,6 +262,7 @@ TESTS = \ cp/file-perm-race \ cp/into-self \ cp/link \ + cp/link-heap \ cp/link-no-deref \ cp/link-preserve \ cp/no-deref-link1 \ -- cgit v1.2.3-54-g00ecf