-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add an allocator and a finalizer used to run the given fn with a pre-allocated resource #25
Conversation
…allocated resource
Currently, I did not implemented |
Thanks a lot for this excellent feature. I've ported Two thoughts:
|
Yeah I think your case is legitim and the initial case (one resource per run) is legitim too. I will try to merge your commit and prepare something on the API level. Thanks for your feedback, it helps a lot. |
/cc @craigfe I finalize the API which gives you the choice between the allocation of a single resource or multiple resources. I need to check a bit the assembly generated and if OCaml is able to inline correctly Can you test this new version with your usecase and see if something is wrong about results? Better, can you give me the link to the repository to reproduce on my side? |
I did a deep look on the assembly generated by the compiler and it seems that if we use multiple resources for each run, we can trigger the GC via the |
Finally, if you agree with this interface, I can merge it and prepare a release then 👍. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this improvement! LGTM.
… (0.2.0) CHANGES: - Add missing dependencies (@kit-ty-kate, mirage/bechamel#20) - Upgrade the codebase (@dinosaure, mirage/bechamel#24) - Add a finalizer function to allow the user to allocate resource (@dinosaure, @craigfe, mirage/bechamel#22, mirage/bechamel#25) - Update the documentation (@dinosaure, mirage/bechamel#26)
This is a draft about #22 which asks to allocate some resources, pass them to the given
fn
and free them then. They should not mitigate results but I need a double-check from you @craigfe 👍 . Currently,fact.html
did not change so much with this PR. I believe that it's fine.