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

Add Atomic::const_null #709

Closed
wants to merge 1 commit into from

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented May 31, 2021

Inspired by parking_lot's const_mutex and Mutex::const_new.

This allows creating a null atomic pointer in a constant context on stable Rust.

The nightly feature is still needed to create a null atomic pointer to ?Sized + Pointable types implemented by the user in a const context, but Atomic::const_null will probably be enough for many users.

@taiki-e taiki-e requested a review from jeehoonkang May 31, 2021 13:45
@taiki-e taiki-e force-pushed the epoch-atomic-const-null branch 2 times, most recently from 62ab077 to de17f28 Compare May 31, 2021 13:51
@taiki-e
Copy link
Member Author

taiki-e commented May 31, 2021

Hmm, if we support both Atomic<T>::const_null and Atomic<[MaybeUninit<T>]>::const_null, the user need to specify type to disambiguate. (like, Atomic::<u8>::const_null(), Atomic::<[MaybeUninit<_>]>::const_null())

@taiki-e taiki-e marked this pull request as draft July 12, 2021 13:56
@taiki-e
Copy link
Member Author

taiki-e commented Mar 8, 2022

closing in favor of #797.

@taiki-e taiki-e closed this Mar 8, 2022
@taiki-e taiki-e deleted the epoch-atomic-const-null branch March 8, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant