Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: [PATCH] index-pack: eliminate unlimited recursion in get_delta_base()

From: Shawn Pearce <hidden>
Date: 2016-06-15 22:52:35

2011/12/7 Nguyễn Thái Ngọc Duy [off-list ref]:
Revert the order of delta applying so that by the time a delta is
applied, its base is either non-delta or already inflated.
get_delta_base() is still recursive, but because base's data is always
ready, the inner get_delta_base() call never has any chance to call
itself again.
...
quoted hunk ↗ jump to hunk
@@ -508,10 +508,25 @@ static void *get_base_data(struct base_data *c)
 {
       if (!c->data) {
               struct object_entry *obj = c->obj;
+               struct base_data **delta = NULL;
+               int delta_nr = 0, delta_alloc = 0;

-               if (is_delta_type(obj->type)) {
-                       void *base = get_base_data(c->base);
-                       void *raw = get_data_from_pack(obj);
I think you missed the critical recursion. The real work is the
recursion within find_unresolved_deltas(). This little helper
get_base_data() shouldn't be tripping over these cases unless we have
run out of delta_base_cache_limit and released objects near the base
end of the delta chain, in which case this will restore them.

Maybe this is useful on its own, but in my opinion its not an
interesting patch to consider without first fixing
find_unresolved_deltas's recursion.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help