Browse Source
Copying flags through a graph with deep side branches can cause StackOverflowError. The recursive step to visit the 2nd parent of a merge commit can overflow the stack if these are themselves very deep histories with many branches. Rewrite the loop to iterate up to 500 recursive steps deep before unwinding the stack and running the remaining parts of the graph using a dynamically allocated FIFORevQueue. This approach still allows simple graphs that mostly merge short lived topic branches into master to copy flags with no dynamic memory allocation, relying only on temporary stack extensions. Larger more complex graphs only pay the allocation penalities if copying has to extend outwards "very far" in the graph, which is unlikely for many coloring based algorithms. Change-Id: I1882e6832c916e27dd5f6b7602d9caf66fb39c84stable-3.4
Shawn Pearce
11 years ago
1 changed files with 63 additions and 16 deletions
Loading…
Reference in new issue