Skip to content

Commit ca4dd26

Browse files
authored
Fix: Implement Send/Sync for FixedBitset (#124)
1 parent d1fa2dc commit ca4dd26

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fixedbitset"
3-
version = "0.5.5"
3+
version = "0.5.6"
44
authors = ["bluss"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ Please read the [API documentation here](https://docs.rs/fixedbitset/)
1010

1111
# Recent Changes
1212

13-
- 0.5.5
13+
- 0.5.6
14+
- Fixed FixedBitset not implementing Send/Sync due to the stack size shrink.
15+
- 0.5.5 (yanked)
1416
- [#116](https://github.com/petgraph/fixedbitset/pull/116): Add functions for counting the results of a set operation (`union_count`,
1517
`intersection_count`, `difference_count`, `symmetric_difference_count`) by @james7132.
1618
- [#118](https://github.com/petgraph/fixedbitset/pull/118): Shrink the stack size of FixedBitset. There should be zero stack size overhead
1719
compared to a Vec.
1820
- [#119](https://github.com/petgraph/fixedbitset/pull/119): Fix builds for wasm32.
21+
- [#120](https://github.com/petgraph/fixedbitset/pull/119): Add more utility functions that were previously missing from the public interface:
22+
`contains_any_in_range`, `contains_all_in_range`, `minimum`, `maximum`, `is_full`, `count_zeroes`, and `remove_range`.
1923
- [#121](https://github.com/petgraph/fixedbitset/pull/121): Add support for SIMD acceleration for AVX builds.
2024
- 0.5.4
2125
- [#112](https://github.com/petgraph/fixedbitset/pull/112): Fix undefined behavior in IntoOnes and setup testing with MIRI by @SkiFire13

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ pub struct FixedBitSet {
7676
pub(crate) length: usize,
7777
}
7878

79+
// SAFETY: FixedBitset contains no thread-local state and can be safely sent between threads
80+
unsafe impl Send for FixedBitSet {}
81+
// SAFETY: FixedBitset does not provide simultaneous unsynchronized mutable access to the
82+
// underlying buffer.
83+
unsafe impl Sync for FixedBitSet {}
84+
7985
impl FixedBitSet {
8086
/// Create a new empty **FixedBitSet**.
8187
pub const fn new() -> Self {

0 commit comments

Comments
 (0)