Konstantin A. Olkhovskiy
Konstantin A. Olkhovskiy
Quick idea: maybe runtime handle should include that panic hook guard, as where runtime handle is available, it is assumed that we're executing within OCaml context (called from OCaml via...
Something along these lines maybe ```rust use std::cell::Cell; use std::panic; use std::sync::Once; thread_local! { static GUARD_COUNT: Cell = Cell::new(0); } static INIT: Once = Once::new(); pub struct OcamlPanicGuard; impl OcamlPanicGuard...
Thanks for looking into this! Will definitely try this out, but can't promise to do it soon. We've disabled panic hook so far and mitigated the problem, but having panic...
Maybe some helper like this needs to be added to the library and documented? 🤔 ```rust pub fn ensure_rooted_value(value: ocaml::Value) -> ocaml::Value { match value { ocaml::Value::Raw(v) => unsafe {...
Yeah, sure. Will do.
Not sure about OCaml 5, but with prior versions one was expected to register thread to OCaml runtime before executing any OCaml code on that thread. See [this discuss topic](https://discuss.ocaml.org/t/caml-c-thread-register-in-programs-that-do-not-use-systhreads/9232).
@emchristiansen what architecture did you end up with? I'm also playing around with attempts to integrate Lwt and Rust futures, and so far without much luck, I've created an executor...
Updated: I actually ditched my in-house Executor implementation (that is 90% the one I got from async book anyways 😂 ) and used [async_executor](https://docs.rs/async-executor/latest/async_executor/struct.LocalExecutor.html) crate instead, and it worked! I...
How can I do that? I'm quite new to Rust. I've tried to `mem::forget` the original value, while wrapping it into `Rc` and cloning, Rust seems to not be tricked...
Ah, you mean rooting via OCaml API? I believe rooting does not stop the GC from moving it around as it sees fit. Root is just an integer, so as...