Skip to content
Draft
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
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ include = [
]

[dependencies]
aligned-vec = { version = "0.6.4", default-features = false }
fixedbitset = { version = "0.5.7", default-features = false }
once_cell = { version = "1.21.3", default-features = false, features = ["alloc", "race"] }

Expand All @@ -42,7 +43,7 @@ leopard-codec = "0.2.0"

[features]
default = ["std"]
std = ["fixedbitset/std"]
std = ["fixedbitset/std", "aligned-vec/std"]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nazar-pc
This is the way to do it, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, though I'm wondering if any of the APIs used here actually require/benefit from std at all.


[lib]
bench = false
Expand Down
8 changes: 4 additions & 4 deletions src/engine/shards.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use core::ops::{Bound, Index, IndexMut, Range, RangeBounds};

use aligned_vec::{AVec, CACHELINE_ALIGN};

// ======================================================================
// Shards - CRATE

Expand All @@ -11,7 +11,7 @@ pub(crate) struct Shards {
shard_len_64: usize,

// Flat Vec of `shard_count * shard_len_64 * 64` bytes.
data: Vec<[u8; 64]>,
data: AVec<[u8; 64]>,
}

impl Shards {
Expand All @@ -23,7 +23,7 @@ impl Shards {
Self {
shard_count: 0,
shard_len_64: 0,
data: Vec::new(),
data: AVec::new(CACHELINE_ALIGN),
}
}

Expand Down