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

PersistentRooted update inner workings #70

Open
andrieshiemstra opened this issue Jul 2, 2021 · 0 comments
Open

PersistentRooted update inner workings #70

andrieshiemstra opened this issue Jul 2, 2021 · 0 comments

Comments

@andrieshiemstra
Copy link
Contributor

As discussed here: #65 (comment)

for persistent roots i use a HashMap based on a generated ID, at first i thought i'd just use the inner ptr of JsObejct as ID but then it would not work when multiple jobs add a persistent root for the same object.

Your persistent root can be reference counted and stored in hash map. On GC when constraint for the Runtime instance is executed you just remove all the roots that have 1 reference count left. I think you can even just use Vec there?

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

No branches or pull requests

1 participant