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

Make it possible to not allocate an AliasableBox when type is already StableDeref + AliasableDeref #115

Open
Ten0 opened this issue May 26, 2024 · 0 comments · May be fixed by #120
Open

Comments

@Ten0
Copy link

Ten0 commented May 26, 2024

I've had two use-cases recently for Ouroboros structs where my borrowed field was already a StableDeref + AliasableDeref pointer.
One was a std::cell::Ref, and one was an std::sync::Arc.
In both cases, it seems significantly costly to make the additional allocation so that it gets wrapped into an AliasableBox, and that doesn't seem necessary for soundness.

It would be nice if we could put an annotation on the borrowed field so that instead of getting wrapped into AliasableBox, it just adds necessary assertions that the type is indeed StableDeref + AliasableDeref, and doesn't wrap it.

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