opsengine/ox — pull request #1 by opsengine (2012-11-22 12:40:51+00:00)
Title: Using malloc()

The functions read_element() read_text() read_instruction() were allocating a lot of space if the stack.

This causes a stack overflow when using Ruby fibers, because the stack is limited to 4 kb.

This PR reduces the memory footprint on the stack, allocating it dynamically in the heap. Obviously there is a performance loss (40-50%), but in this way the parser won't crash any more when handling xml files with depth > 4