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 sync::raw::Sem use Unsafe to manage mutability instead of *() #14708

Merged
merged 1 commit into from
Jun 7, 2014

Conversation

gereeter
Copy link
Contributor

@gereeter gereeter commented Jun 6, 2014

Currently, Sem, which is used as a building block for all the blocking primitives, uses a very ugly hack to implement Share and be able to mutate the stored WaitQueue by hiding it all behind a transmuted *(). This PR replaces all that ugly machinery with Unsafe. Beyond being cleaner and not requiring transmute, this removes an allocation in the creation and removes an indirection for access.

bors added a commit that referenced this pull request Jun 7, 2014
Currently, `Sem`, which is used as a building block for all the blocking primitives, uses a very ugly hack to implement `Share` and be able to mutate the stored `WaitQueue` by hiding it all behind a `transmute`d `*()`. This PR replaces all that ugly machinery with `Unsafe`. Beyond being cleaner and not requiring `transmute`, this removes an allocation in the creation and removes an indirection for access.
@bors bors closed this Jun 7, 2014
@bors bors merged commit f2f1991 into rust-lang:master Jun 7, 2014
@gereeter gereeter deleted the faster-sem branch December 17, 2015 01:29
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

Successfully merging this pull request may close these issues.

3 participants