Files
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
..
2011-12-13 21:58:51 -08:00
2011-12-19 16:05:50 -08:00
2011-12-19 16:06:22 -08:00
2011-12-13 10:17:50 -08:00
2011-12-13 22:18:00 -08:00
2011-11-07 22:12:19 -08:00
2011-12-21 12:02:44 -08:00
2011-12-19 16:05:34 -08:00
2011-12-22 11:27:26 -08:00
2011-11-07 22:12:19 -08:00
2011-12-22 15:30:22 -08:00
2011-12-13 23:07:47 -08:00