-
Notifications
You must be signed in to change notification settings - Fork 42
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
Would it be possible for ThreadLocal
to return pinned references to the local data?
#66
Comments
Yes, this can be guaranteed. But I'm not sure how to expose this as an API. |
Would it not be |
No, that's unsound: |
But just because the API returns a Isn't "the underlying memory will remain valid if you |
But the lifetime is still tied to the lifetime of the |
I don't think that violates |
That is, could this library guarantee that the local data will not move until the
ThreadLocal
is dropped, permitting unsafe code to access the local data (using raw pointers) after the the borrow of theThreadLocal
itself expires?The text was updated successfully, but these errors were encountered: