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 generic Atomic<T> type #8

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add generic Atomic<T> type #8

wants to merge 1 commit into from

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented Mar 21, 2022

Note: this patch currently adds generic atomic type to the main portable-atomic crate, but should be to the portable-atomic-util crate.

  • Support for various operations on Copy types and support for swap and store on non-Copy types.
  • Support for primitives, immutable references, function pointers, NonNull, NoneZero, etc.
  • Support for user-defined structs and enums, including those with multiple fields and padding. (via #[derive(Atomicable)])
  • Support for user-defined unions. (via #[derive(Atomicable)])

This should meet the requirements that I said in #1.

Requirements:

Closes #1

@taiki-e taiki-e force-pushed the generic branch 6 times, most recently from ab2a285 to da35a39 Compare March 25, 2022 16:11
src/generic/mod.rs Outdated Show resolved Hide resolved
bors bot added a commit that referenced this pull request Sep 12, 2022
38: Add empty portable-atomic-util crate r=taiki-e a=taiki-e

This adds an empty crate named `portable-atomic-util`.

For now, I'm considering putting the features proposed in #1 (#8) and #37 into this crate, but they may be merged into the main `portable-atomic` crate in the future.


Co-authored-by: Taiki Endo <[email protected]>
@taiki-e taiki-e added the A-portable-atomic-util Area: related to portable-atomic-util crate label Jan 12, 2023
@taiki-e taiki-e force-pushed the main branch 2 times, most recently from a4d8248 to 6d90a3d Compare July 29, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-portable-atomic-util Area: related to portable-atomic-util crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provides generic Atomic<T> type
1 participant