Skip to content
Merged
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
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description = "Reference counted vector data structure."

[dev-dependencies]
criterion = "0.4"
blink-alloc = "0.2.5"
blink-alloc = "0.4.0"

[[bench]]
name = "vector"
Expand All @@ -21,9 +21,9 @@ harness = false
debug = true

[dependencies]
allocator-api2 = "0.2.4"
allocator-api2 = "0.4.0"

[features]
default = ["std"]
nightly = ["allocator-api2/nightly", "blink-alloc/nightly"]
nightly = ["blink-alloc/nightly"]
std = ["allocator-api2/std"]
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ pub use shared::{AtomicSharedVector, RefCountedVector, SharedVector};
pub use vector::{Vector, RawVector};

pub mod alloc {
#[cfg(not(feature = "nightly"))]
pub use allocator_api2::alloc::{AllocError, Allocator, Global};
#[cfg(feature = "nightly")]
pub use std::alloc::{AllocError, Allocator, Global};
}

pub(crate) fn grow_amortized(len: usize, additional: usize) -> usize {
Expand Down Expand Up @@ -111,7 +114,7 @@ macro_rules! arc_vector {

#[test]
fn vector_macro() {
pub use allocator_api2::alloc::Global;
pub use crate::alloc::Global;

let v1: Vector<u32> = vector![0, 1, 2, 3, 4, 5];
let v2: Vector<u32> = vector![2; 4];
Expand Down
Loading