But AFAICT, the pop and restore operations stop working once you call del. But if your algorithm only ever adds and backtraces, you should be fine (if you know how many elements you will add or are happy to realloc your arrays from time to time, making add logarithmic).