Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ coveralls = { repository = "darrenldl/reed-solomon-erasure" }
[dependencies]
libc = { version = "0.2", optional = true }
# `log2()` impl for `no_std`
libm = "0.2.1"
lru = "0.7.8"
libm = "0.2.8"
lru = "0.12.4"
# Efficient `Mutex` implementation for `std` environment
parking_lot = { version = "0.11.2", optional = true }
smallvec = "1.2"
parking_lot = { version = "0.12.3", optional = true }
smallvec = "1.13"
# `Mutex` implementation for `no_std` environment with the same high-level API as `parking_lot`
spin = { version = "0.9.2", default-features = false, features = ["spin_mutex"] }
spin = { version = "0.9.8", default-features = false, features = ["spin_mutex"] }

[dev-dependencies]
rand = { version = "0.7.2", features = ["small_rng"] }
quickcheck = "0.9"
rand = { version = "0.8.5", features = ["small_rng"] }
quickcheck = "1.0"

# Scientific benchmarking
criterion = { version = "0.4.0", features = ["html_reports"] }
criterion = { version = "0.5.1", features = ["html_reports"] }

[build-dependencies]
cc = { version = "1.0", optional = true }
cc = { version = "1.1", optional = true }

[[bench]]
name = "bandwidth"
Expand Down
6 changes: 5 additions & 1 deletion src/core.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
extern crate alloc;

use core::num::NonZeroUsize;

use alloc::sync::Arc;
use alloc::vec;
use alloc::vec::Vec;
Expand Down Expand Up @@ -462,7 +464,9 @@ impl<F: Field> ReedSolomon<F> {
parity_shard_count: parity_shards,
total_shard_count: total_shards,
matrix,
data_decode_matrix_cache: Mutex::new(LruCache::new(DATA_DECODE_MATRIX_CACHE_CAPACITY)),
data_decode_matrix_cache: Mutex::new(LruCache::new(
NonZeroUsize::new(DATA_DECODE_MATRIX_CACHE_CAPACITY).unwrap(),
)),
})
}

Expand Down
4 changes: 2 additions & 2 deletions src/galois_16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ impl Element {
#[cfg(test)]
mod tests {
use super::*;
use quickcheck::Arbitrary;
use quickcheck::{Arbitrary, Gen};

impl Arbitrary for Element {
fn arbitrary<G: quickcheck::Gen>(gen: &mut G) -> Self {
fn arbitrary(gen: &mut Gen) -> Self {
let a = u8::arbitrary(gen);
let b = u8::arbitrary(gen);

Expand Down
4 changes: 2 additions & 2 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ fn test_too_many_shards() {
fn test_shard_count() {
let mut rng = thread_rng();
for _ in 0..10 {
let data_shard_count = rng.gen_range(1, 128);
let parity_shard_count = rng.gen_range(1, 128);
let data_shard_count = rng.gen_range(1..128);
let parity_shard_count = rng.gen_range(1..128);

let total_shard_count = data_shard_count + parity_shard_count;

Expand Down