On 29 October 2013 12:08, Niko Matsakis <n...@alum.mit.edu> wrote:
> One non-technical difficulty to failing on overflow is how to handle
> user-defined destructors when there is no stack to run them on

>From C++ experience the need to handle recursion comes from code like
parsers or tree-like structure navigation. In such cases the only
relevant destructors are those that release heap-allocated memory.
This suggests to have a module or function level annotation that
states that the code does not run custom destructors. Then the runtime
can provide a function like run_with_stack_check_enabled() that runs
such destructor-less code while allowing to recover from the stack
overflow. Then the only problem would be to properly release all
~temporaries.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to