xmlserializer icon indicating copy to clipboard operation
xmlserializer copied to clipboard

Implement in a non-recursive way to avoid stack overflows

Open ghost opened this issue 7 years ago • 2 comments

Some documents will cause the parser to throw a stack overflow exception (Maximum call stack exceeded). This can be avoided by making the code-non recursive.

ghost avatar Oct 30 '18 18:10 ghost

Happy to see an idea and/or code for that.

cburgmer avatar Nov 11 '18 20:11 cburgmer

Non-recursive graph traversal is often done by making use of an auxiliary data structure, a stack or queue. The advantage of using a heap-allocated data structure rather than the call stack is that the heap usually has a higher limit.

Examples of non-recursive graph traversal include non-recursive DFS or BFS.

ghost avatar Nov 11 '18 21:11 ghost