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

Fix Send and Sync implementations on Id and WeakId #8

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

madsmtm
Copy link
Owner

@madsmtm madsmtm commented Aug 31, 2021

See comments in the code for reasoning.

The impl for Id<T, Shared> is the same as Arc<T>, the impl for Id<T, Owned> is the same as Box<T> and the impl for WeakId is the same as Id<T, Shared> (because you can get the latter from the former).

See this blog post by nyanpasu64 for more information on this.

Replaces SSheldon/rust-objc-id#8.

See comments in the code for reasoning.

The impl for `Id<T, Shared>` is the same as `Arc<T>` and the impl for `Id<T, Owned>` is the same as `Box<T>`.
The implementations follow the same reasoning as `Id<T, Shared>`, since you can upgrade `WeakId` to `Id<T, Shared>`.
@madsmtm madsmtm added the bug Something isn't working label Aug 31, 2021
@madsmtm madsmtm merged commit 3d4596a into master Aug 31, 2021
@madsmtm madsmtm deleted the id-fix-send-sync branch August 31, 2021 22:07
@madsmtm madsmtm mentioned this pull request Sep 5, 2021
80 tasks
@madsmtm madsmtm added this to the objc2 v0.3 milestone Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant