Skip to content

Commit

Permalink
Use CachePadded from crossbeam submodule (#115)
Browse files Browse the repository at this point in the history
* Use CachePadded from crossbeam submodule

* CI: check if cache_padded.rs has been updated

* DOC: mention that cache_padded.rs is used from crossbeam
  • Loading branch information
mgeier authored Apr 3, 2024
1 parent 2686a28 commit a4a94f8
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/cache-padded-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check for changes in cache_padded.rs
on:
schedule:
- cron: "11 11 * * Mon"
jobs:
check-cache-padded:
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v3
with:
submodules: true
- name: Fetch newest stuff from crossbeam submodule
working-directory: crossbeam
run: |
git fetch origin master
- name: Check for changes in cache_padded.rs
working-directory: crossbeam
run: |
git diff origin/master -- crossbeam-utils/src/cache_padded.rs
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "crossbeam"]
path = crossbeam
url = https://github.com/crossbeam-rs/crossbeam.git
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ exclude = [
default = ["std"]
std = []

[dependencies]
# "std" is enabled by default
crossbeam-utils = { version = "0.8", default-features = false }

[dev-dependencies]
rand = "0.8"
criterion = "0.3"
# TODO: This is only needed for the doctests of cache_padded.rs! Is there a way to avoid this?
crossbeam-utils = { version = "0.8", default-features = false }

[profile.bench]
codegen-units = 1
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ Licensed under either of

at your option.

Note that this crate contains a copy of the file `cache_padded.rs` from
https://github.com/crossbeam-rs/crossbeam.

#### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
Expand Down
1 change: 1 addition & 0 deletions crossbeam
Submodule crossbeam added at 9e8596
1 change: 1 addition & 0 deletions src/cache_padded.rs
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ use core::marker::PhantomData;
use core::mem::{ManuallyDrop, MaybeUninit};
use core::sync::atomic::{AtomicUsize, Ordering};

use crossbeam_utils::CachePadded;
#[allow(dead_code)]
mod cache_padded;
use cache_padded::CachePadded;

pub mod chunks;

Expand Down

0 comments on commit a4a94f8

Please sign in to comment.