1
0
mirror of https://github.com/git/git.git synced 2024-09-28 17:22:20 +02:00
git/builtin
Nguyễn Thái Ngọc Duy 2baad22013 index-pack: eliminate recursion in find_unresolved_deltas
Current find_unresolved_deltas() links all bases together in a form of
tree, using struct base_data, with prev_base pointer to point to
parent node. Then it traverses down from parent to children in
recursive manner with all base_data allocated on stack.

To eliminate recursion, we simply need to put all on heap
(parse_pack_objects and fix_unresolved_deltas). After that, it's
simple non-recursive depth-first traversal loop. Each node also
maintains its own state (ofs and ref indices) to iterate over all
children nodes.

So we process one node:

 - if it returns a new (child) node (a parent base), we link it to our
   tree, then process the new node.

 - if it returns nothing, the node is done, free it. We go back to
   parent node and resume whatever it's doing.

and do it until we have no nodes to process.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-16 14:28:27 -08:00
..
add.c
annotate.c
apply.c Merge branch 'bc/maint-apply-check-no-patch' into maint 2011-12-21 11:42:45 -08:00
archive.c
bisect--helper.c
blame.c
branch.c
bundle.c
cat-file.c
check-attr.c
check-ref-format.c
checkout-index.c
checkout.c
clean.c
clone.c clone: the -o option has nothing to do with <branch> 2011-12-21 11:26:30 -08:00
commit-tree.c Merge branch 'nd/war-on-nul-in-commit' 2011-12-22 11:27:26 -08:00
commit.c Merge branch 'jk/maint-strbuf-missing-init' 2011-12-22 11:27:31 -08:00
config.c
count-objects.c
describe.c
diff-files.c
diff-index.c
diff-tree.c
diff.c
fast-export.c
fetch-pack.c
fetch.c
fmt-merge-msg.c
for-each-ref.c
fsck.c
gc.c
grep.c
hash-object.c
help.c
index-pack.c index-pack: eliminate recursion in find_unresolved_deltas 2012-01-16 14:28:27 -08:00
init-db.c
log.c Sync with v1.7.8.1 2011-12-21 12:02:44 -08:00
ls-files.c
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'jk/maint-strbuf-missing-init' 2011-12-22 11:27:31 -08:00
mktag.c
mktree.c
mv.c
name-rev.c
notes.c Merge branch 'nd/war-on-nul-in-commit' 2011-12-22 11:27:26 -08:00
pack-objects.c
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
push.c
read-tree.c
receive-pack.c
reflog.c
remote-ext.c
remote-fd.c
remote.c
replace.c
rerere.c
reset.c
rev-list.c
rev-parse.c
revert.c Merge branch 'rr/revert-cherry-pick' 2011-12-22 15:30:22 -08:00
rm.c
send-pack.c
shortlog.c
show-branch.c
show-ref.c
stripspace.c
symbolic-ref.c
tag.c
tar-tree.c
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c
var.c
verify-pack.c
verify-tag.c
write-tree.c