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

Use sharded-slab to store tracked struct instance data #491

Open
nikomatsakis opened this issue Jun 17, 2024 · 0 comments
Open

Use sharded-slab to store tracked struct instance data #491

nikomatsakis opened this issue Jun 17, 2024 · 0 comments

Comments

@nikomatsakis
Copy link
Member

nikomatsakis commented Jun 17, 2024

The existing implementation uses a direct pointer for tracked struct data. This is maximally efficient but not safe. To make it safe, we would need to have a cheap way to ensure that the tracked struct has not been deleted -- this could only happen if user's "leak" data to bypass salsa's dependency tracking, but unfortunately that is possible without triggering UB (though it does require safe code). One way to do this would be to use arenas to allocate tracked struct storage. But another option is to first try using the sharded slab create -- while not maximally efficient, it presents us a safe interface to build on and may be "fast enough". We can explore future refinements later.

@nikomatsakis nikomatsakis self-assigned this Jun 17, 2024
@nikomatsakis nikomatsakis changed the title Port over to use sharded-slab Use sharded-slab to store tracked struct instance data Jun 17, 2024
@nikomatsakis nikomatsakis removed their assignment Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant