Skip to content

Commit

Permalink
util: Rewrite Arc based on std::sync::Arc
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Dec 27, 2023
1 parent 95f2f37 commit e8b3e3b
Show file tree
Hide file tree
Showing 8 changed files with 2,955 additions and 573 deletions.
2 changes: 2 additions & 0 deletions .github/.cspell/project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ DESTDIR
DEVEL
dlsym
DWCAS
elems
espup
exynos
FIQs
Expand Down Expand Up @@ -157,6 +158,7 @@ uapi
uart
umax
umin
unclonable
unistd
unparse
usart
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ jobs:
if: (matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64')) || startsWith(matrix.target, 'aarch64') && !(contains(matrix.target, '-musl') && matrix.flags == '') || startsWith(matrix.target, 'armv5te') || matrix.target == 'arm-linux-androideabi'
# outline-atomics is disabled by default on aarch64 musl with static linking and powerpc64
# powerpc64le- (little-endian) is skipped because it is pwr8 by default
- run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE
- run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE --exclude api-test
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_outline_atomics
RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_outline_atomics
if: startsWith(matrix.target, 'aarch64') && contains(matrix.target, '-musl') && matrix.flags == '' || startsWith(matrix.target, 'powerpc64-')
- run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE
- run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE --exclude api-test
env:
# Note: detect_false cfg is intended to make it easy for portable-atomic developers to
# test cases such as has_cmpxchg16b == false, has_lse == false,
Expand Down Expand Up @@ -398,6 +398,7 @@ jobs:
matrix:
include:
- rust: '1.34'
- rust: '1.36'
- rust: '1.59'
- rust: stable
- rust: beta
Expand Down Expand Up @@ -519,6 +520,7 @@ jobs:
persist-credentials: false
- name: Install Rust
run: rustup toolchain add nightly --no-self-update --component miri && rustup default nightly
- uses: taiki-e/install-action@cargo-hack
# - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils
- run: echo "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}"
if: matrix.target != 'x86_64-unknown-linux-gnu'
Expand All @@ -544,6 +546,7 @@ jobs:
persist-credentials: false
- name: Install Rust
run: rustup toolchain add nightly --no-self-update && rustup default nightly
- uses: taiki-e/install-action@cargo-hack
# - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils
- run: |
echo "ASAN_OPTIONS=detect_stack_use_after_return=1" >>"${GITHUB_ENV}"
Expand Down Expand Up @@ -578,6 +581,7 @@ jobs:
persist-credentials: false
- name: Install Rust
run: rustup toolchain add nightly --no-self-update && rustup default nightly
- uses: taiki-e/install-action@cargo-hack
# - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils
- uses: taiki-e/install-action@valgrind
- run: tools/test.sh valgrind -vv
Expand Down
12 changes: 12 additions & 0 deletions portable-atomic-util/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,22 @@ fn main() {
if !version.probe(36, 2019, 4, 14) {
println!("cargo:rustc-cfg=portable_atomic_no_alloc");
}
// Layout::{align_to,pad_to_align,extend,array} stabilized in Rust 1.44 (nightly-2020-04-22) https://github.com/rust-lang/rust/pull/69362
if !version.probe(44, 2020, 4, 21) {
println!("cargo:rustc-cfg=portable_atomic_no_alloc_layout_extras");
}
// min_const_generics stabilized in Rust 1.51 (nightly-2020-12-28): https://github.com/rust-lang/rust/pull/79135
if !version.probe(51, 2020, 12, 27) {
println!("cargo:rustc-cfg=portable_atomic_no_min_const_generics");
}
// unsafe_op_in_unsafe_fn stabilized in Rust 1.52 (nightly-2021-03-11): https://github.com/rust-lang/rust/pull/79208
if !version.probe(52, 2021, 3, 10) {
println!("cargo:rustc-cfg=portable_atomic_no_unsafe_op_in_unsafe_fn");
}
// https://github.com/rust-lang/rust/pull/84662 merged in Rust 1.56 (nightly-2021-08-02).
if !version.probe(56, 2021, 8, 1) {
println!("cargo:rustc-cfg=portable_atomic_no_core_unwind_safe");
}

if version.nightly {
// `cfg(sanitize = "..")` is not stabilized.
Expand Down
Loading

0 comments on commit e8b3e3b

Please sign in to comment.