author | Linus Torvalds <torvalds@linux-foundation.org> | |
Thu, 25 Oct 2007 18:19:10 +0000 (11:19 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 27 Oct 2007 06:18:05 +0000 (23:18 -0700) | ||
commit | 9fb88419ba85e641006c80db53620423f37f1c93 | |
tree | 8faef69079486e3c57cbc0009073b8ae98295c0f | tree | snapshot |
parent | cb1491b6bff20748532c9e50afc7f9d6896167a8 | commit | diff |
Ref-count the filespecs used by diffcore
Rather than copy the filespecs when introducing new versions of them
(for rename or copy detection), use a refcount and increment the count
when reusing the diff_filespec.
This avoids unnecessary allocations, but the real reason behind this is
a future enhancement: we will want to track shared data across the
copy/rename detection. In order to efficiently notice when a filespec
is used by a rename, the rename machinery wants to keep track of a
rename usage count which is shared across all different users of the
filespec.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Rather than copy the filespecs when introducing new versions of them
(for rename or copy detection), use a refcount and increment the count
when reusing the diff_filespec.
This avoids unnecessary allocations, but the real reason behind this is
a future enhancement: we will want to track shared data across the
copy/rename detection. In order to efficiently notice when a filespec
is used by a rename, the rename machinery wants to keep track of a
rename usage count which is shared across all different users of the
filespec.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | diff | blob | history | |
diffcore-rename.c | diff | blob | history | |
diffcore.h | diff | blob | history |