Skip to content
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 custom allocator with precise garbage collector #159

Open
jeffplaisance opened this issue Aug 30, 2020 · 1 comment
Open

Add custom allocator with precise garbage collector #159

jeffplaisance opened this issue Aug 30, 2020 · 1 comment

Comments

@jeffplaisance
Copy link

I am fairly certain that it is possible to write an allocator for rrb trees which uses a precise mark sweep garbage collector. We did it for 2-3 trees for a project and I don't see anything fundamentally different in rrb trees that would prevent it from working here as well. You just track all the root nodes using RAII and the rest of it is pretty obvious from there. The fact that all the allocations can be the same size makes it a lot easier.

The refcounting and ownership approach is almost certainly fine for my planned use case for immer (MVCC structures in a database) but I wanted to make sure y'all are aware that libgc isn't the only option for gc! If you are interested in this approach please let me know. Thanks!

@arximboldi
Copy link
Owner

Yes, I am aware that libgc is not the only approach :)

I think that integrating a different GC though would need some work on immer side, because the current memory policy API is a bit limited (there is no way to RAII mark roots, etc.) I don't have in principle anything against integrating such work if that'd be useful for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants