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

Question: Why not T: ?Sized? #6

Open
simnalamburt opened this issue Oct 4, 2024 · 2 comments
Open

Question: Why not T: ?Sized? #6

simnalamburt opened this issue Oct 4, 2024 · 2 comments

Comments

@simnalamburt
Copy link
Contributor

Currently, circ users can still use it with !Sized types, albeit a bit inconveniently, by coding like AtomicRc<Box<T>>. If the fat pointer is bothersome, AtomicRc<ThinBox<T>> could be used instead. It would be more convenient if circ handled this automatically. Is there a specific reason circ only supports Sized types?

(This is probably a question I could answer by reading the code, but I haven’t had a chance to look into it deeply. Sorry, haha ;) )

@powergee
Copy link
Member

powergee commented Oct 4, 2024

I believe you're right; it should be possible to relax the type restriction by allowing ?Sized. Additionally, I think using ThinBox for pointer tagging may not be necessary since we can still determine the available width of the low bits statically (see low_bits<T>()), similar to what crossbeam-epoch does.

This library started as a proof-of-concept implementation of the original paper, and at that time, we did not consider unsized types. I believe it's now time to support them for broader applicability, as well as for cross-type tracing (#4).

@simnalamburt
Copy link
Contributor Author

That sounds great. Making it more user-friendly like this will not only increase the value of the research results but also raise more awareness about Safe Memory Reclamation. SMR research has made tremendous progress, but we need to address the current situation where developers are still resorting to using std::sync::Arc.

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

2 participants