-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add global and generational roots #25
base: master
Are you sure you want to change the base?
Conversation
8689470
to
37bd1b2
Compare
About this one, my intention is to introduce "BoxRoots" in the next version of ocaml-interop, which will serve as a faster replacement to global roots (and probably will also replace local roots). I think this new API is something you may find useful if you are using a high amount of global roots. Work (for the generic implementation that is independent from ocaml-interop) is being done here right now in case you are interested in knowing more about it: https://gitlab.com/ocaml-rust/ocaml-boxroot/ |
Thanks for the pointer to boxroots, I had no idea you could hook into the GC like that. |
@g2p boxroots have been merged into master. I plan to do a new release (0.6.0) today, when I will go through your PRs. Does this one still make sense? Global roots can do one thing that Boxroots cannot, and that is registering an arbitrary address as a root. But such functionality is not often needed, and for everything else Boxroots beat global roots. Do you think this PR is still relevant? |
Personally I would prefer to still have functionality that works without boxroots, because the deep integration of boxroots support with the OCaml runtime in the current implementation makes using Rust as an extension language for OCaml libraries (my use case, and one ocaml-rs targets) a bit visible (need for setup and teardown, likely interactions with Mirage and ocaml-freestanding) and not seamless. Though that discussion is about scope, and goes beyond this PR. |
@g2p setup and teardown requirements are temporary, and will be removed from future releases (irrespectively of if boxroots get integrated into OCaml or not). |
Btw, here is the OCaml RFC for boxroots in case you are interested in following the discussion ocaml/RFCs#22 |
Okay; pardon the worry. I can table this for now, and wish the RFC well. |
This requires ocaml-sys 0.19.1, which exposes the required runtime API.