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 2 commits into
base: main
Choose a base branch
from
Draft

Add generic Atomic<T> type #8

wants to merge 2 commits 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
@taiki-e taiki-e force-pushed the generic branch 2 times, most recently from 318ea8e to bf30a6e Compare March 25, 2022 19:26
@taiki-e taiki-e force-pushed the generic branch 3 times, most recently from f4b7e57 to d876bf3 Compare May 1, 2022 07:03
@taiki-e taiki-e force-pushed the generic branch 2 times, most recently from 06262ed to bbfda0a Compare July 8, 2022 13:46
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
@taiki-e taiki-e force-pushed the main branch 5 times, most recently from c05229d to 9d65f58 Compare January 7, 2025 17:29
@taiki-e taiki-e force-pushed the main branch 5 times, most recently from 53c8409 to 378f6cd Compare January 15, 2025 15:07
@taiki-e taiki-e force-pushed the main branch 8 times, most recently from 52836df to 4a9ffc4 Compare February 5, 2025 17:50
@taiki-e taiki-e force-pushed the main branch 5 times, most recently from a368389 to eeb0235 Compare February 24, 2025 12:09
@taiki-e taiki-e force-pushed the main branch 5 times, most recently from 77c5d0d to 813bf8f Compare March 7, 2025 16:12
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