On 02/02/2013 01:16 AM, Patrick Walton wrote:
On 2/1/13 11:02 PM, Brian Anderson wrote:
In the library we add this sort of function that simply guarantee that
the closure has some amount of stack available.

do reserve_stack(Standard) { rust_task_fail(); }
do reserve_stack(Tiny) {... }
do reserve_stack(Large) { }
do reserve_stack(Size(4096)) { }

My main worry about this is that it's always guesswork. Determining how much stack a C function needs is really hard and involves doing a lot of non-local reasoning. Getting it wrong can result in exploitable security vulnerabilities. From a safety POV, it seems that you always really want as big a stack as possible, unless the function is something trivial like floor().

Perhaps the API is wrong then. I do think this capability is desirable for core and superior to running code in the red zone. Maybe the primary interface is a nullary function and there are alternate ways to control the segment size.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to