fix pools tests
This commit is contained in:
@@ -258,6 +258,7 @@ pub trait PoolProvider {
|
|||||||
|
|
||||||
/// Delete data inside the pool given a [PoolAddr].
|
/// Delete data inside the pool given a [PoolAddr].
|
||||||
fn delete(&mut self, addr: PoolAddr) -> Result<(), PoolError>;
|
fn delete(&mut self, addr: PoolAddr) -> Result<(), PoolError>;
|
||||||
|
|
||||||
fn has_element_at(&self, addr: &PoolAddr) -> Result<bool, PoolError>;
|
fn has_element_at(&self, addr: &PoolAddr) -> Result<bool, PoolError>;
|
||||||
|
|
||||||
/// Retrieve the length of the data at the given store address.
|
/// Retrieve the length of the data at the given store address.
|
||||||
@@ -1597,223 +1598,228 @@ mod tests {
|
|||||||
mod heapless_tests {
|
mod heapless_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::static_subpool;
|
use crate::static_subpool;
|
||||||
use std::cell::UnsafeCell;
|
|
||||||
use std::sync::Mutex;
|
|
||||||
|
|
||||||
const SUBPOOL_1_BLOCK_SIZE: usize = 4;
|
const SUBPOOL_1_BLOCK_SIZE: usize = 4;
|
||||||
const SUBPOOL_1_NUM_ELEMENTS: u16 = 4;
|
const SUBPOOL_1_NUM_ELEMENTS: u16 = 4;
|
||||||
|
|
||||||
static SUBPOOL_1: static_cell::ConstStaticCell<
|
const SUBPOOL_2_NUM_ELEMENTS: u16 = 2;
|
||||||
|
const SUBPOOL_2_BLOCK_SIZE: usize = 8;
|
||||||
|
|
||||||
|
const SUBPOOL_3_NUM_ELEMENTS: u16 = 1;
|
||||||
|
const SUBPOOL_3_BLOCK_SIZE: usize = 16;
|
||||||
|
|
||||||
|
const SUBPOOL_4_NUM_ELEMENTS: u16 = 2;
|
||||||
|
const SUBPOOL_4_BLOCK_SIZE: usize = 16;
|
||||||
|
|
||||||
|
const SUBPOOL_5_NUM_ELEMENTS: u16 = 1;
|
||||||
|
const SUBPOOL_5_BLOCK_SIZE: usize = 8;
|
||||||
|
|
||||||
|
const SUBPOOL_6_NUM_ELEMENTS: u16 = 1;
|
||||||
|
const SUBPOOL_6_BLOCK_SIZE: usize = 12;
|
||||||
|
|
||||||
|
macro_rules! make_heapless_pool {
|
||||||
|
($prefix:ident) => {{
|
||||||
|
paste::paste! {
|
||||||
|
static [<$prefix _SUBPOOL_1>]: static_cell::ConstStaticCell<
|
||||||
[u8; SUBPOOL_1_NUM_ELEMENTS as usize * SUBPOOL_1_BLOCK_SIZE],
|
[u8; SUBPOOL_1_NUM_ELEMENTS as usize * SUBPOOL_1_BLOCK_SIZE],
|
||||||
> = static_cell::ConstStaticCell::new(
|
> = static_cell::ConstStaticCell::new(
|
||||||
[0; SUBPOOL_1_NUM_ELEMENTS as usize * SUBPOOL_1_BLOCK_SIZE],
|
[0; SUBPOOL_1_NUM_ELEMENTS as usize * SUBPOOL_1_BLOCK_SIZE],
|
||||||
);
|
);
|
||||||
|
|
||||||
static SUBPOOL_1_SIZES: Mutex<UnsafeCell<[usize; SUBPOOL_1_NUM_ELEMENTS as usize]>> =
|
static [<$prefix _SUBPOOL_1_SIZES>]: std::sync::Mutex<
|
||||||
Mutex::new(UnsafeCell::new(
|
std::cell::UnsafeCell<[usize; SUBPOOL_1_NUM_ELEMENTS as usize]>
|
||||||
[STORE_FREE; SUBPOOL_1_NUM_ELEMENTS as usize],
|
> = std::sync::Mutex::new(
|
||||||
));
|
std::cell::UnsafeCell::new([STORE_FREE; SUBPOOL_1_NUM_ELEMENTS as usize])
|
||||||
|
);
|
||||||
|
|
||||||
const SUBPOOL_2_NUM_ELEMENTS: u16 = 2;
|
static [<$prefix _SUBPOOL_2>]: static_cell::ConstStaticCell<
|
||||||
const SUBPOOL_2_BLOCK_SIZE: usize = 8;
|
|
||||||
static SUBPOOL_2: static_cell::ConstStaticCell<
|
|
||||||
[u8; SUBPOOL_2_NUM_ELEMENTS as usize * SUBPOOL_2_BLOCK_SIZE],
|
[u8; SUBPOOL_2_NUM_ELEMENTS as usize * SUBPOOL_2_BLOCK_SIZE],
|
||||||
> = static_cell::ConstStaticCell::new(
|
> = static_cell::ConstStaticCell::new(
|
||||||
[0; SUBPOOL_2_NUM_ELEMENTS as usize * SUBPOOL_2_BLOCK_SIZE],
|
[0; SUBPOOL_2_NUM_ELEMENTS as usize * SUBPOOL_2_BLOCK_SIZE],
|
||||||
);
|
);
|
||||||
static SUBPOOL_2_SIZES: static_cell::ConstStaticCell<
|
|
||||||
|
static [<$prefix _SUBPOOL_2_SIZES>]: static_cell::ConstStaticCell<
|
||||||
[usize; SUBPOOL_2_NUM_ELEMENTS as usize],
|
[usize; SUBPOOL_2_NUM_ELEMENTS as usize],
|
||||||
> = static_cell::ConstStaticCell::new([STORE_FREE; SUBPOOL_2_NUM_ELEMENTS as usize]);
|
> = static_cell::ConstStaticCell::new(
|
||||||
|
[STORE_FREE; SUBPOOL_2_NUM_ELEMENTS as usize]
|
||||||
const SUBPOOL_3_NUM_ELEMENTS: u16 = 1;
|
|
||||||
const SUBPOOL_3_BLOCK_SIZE: usize = 16;
|
|
||||||
static_subpool!(
|
|
||||||
SUBPOOL_3,
|
|
||||||
SUBPOOL_3_SIZES,
|
|
||||||
SUBPOOL_3_NUM_ELEMENTS as usize,
|
|
||||||
SUBPOOL_3_BLOCK_SIZE
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const SUBPOOL_4_NUM_ELEMENTS: u16 = 2;
|
static [<$prefix _SUBPOOL_3>]: static_cell::ConstStaticCell<
|
||||||
const SUBPOOL_4_BLOCK_SIZE: usize = 16;
|
[u8; SUBPOOL_3_NUM_ELEMENTS as usize * SUBPOOL_3_BLOCK_SIZE],
|
||||||
static_subpool!(
|
> = static_cell::ConstStaticCell::new(
|
||||||
SUBPOOL_4,
|
[0; SUBPOOL_3_NUM_ELEMENTS as usize * SUBPOOL_3_BLOCK_SIZE],
|
||||||
SUBPOOL_4_SIZES,
|
|
||||||
SUBPOOL_4_NUM_ELEMENTS as usize,
|
|
||||||
SUBPOOL_4_BLOCK_SIZE
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const SUBPOOL_5_NUM_ELEMENTS: u16 = 1;
|
static [<$prefix _SUBPOOL_3_SIZES>]: static_cell::ConstStaticCell<
|
||||||
const SUBPOOL_5_BLOCK_SIZE: usize = 8;
|
[usize; SUBPOOL_3_NUM_ELEMENTS as usize],
|
||||||
static_subpool!(
|
> = static_cell::ConstStaticCell::new(
|
||||||
SUBPOOL_5,
|
[STORE_FREE; SUBPOOL_3_NUM_ELEMENTS as usize]
|
||||||
SUBPOOL_5_SIZES,
|
|
||||||
SUBPOOL_5_NUM_ELEMENTS as usize,
|
|
||||||
SUBPOOL_5_BLOCK_SIZE
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const SUBPOOL_6_NUM_ELEMENTS: u16 = 1;
|
|
||||||
const SUBPOOL_6_BLOCK_SIZE: usize = 12;
|
|
||||||
static_subpool!(
|
|
||||||
SUBPOOL_6,
|
|
||||||
SUBPOOL_6_SIZES,
|
|
||||||
SUBPOOL_6_NUM_ELEMENTS as usize,
|
|
||||||
SUBPOOL_6_BLOCK_SIZE
|
|
||||||
);
|
|
||||||
|
|
||||||
fn small_heapless_pool() -> StaticHeaplessMemoryPool<3> {
|
|
||||||
let mut heapless_pool: StaticHeaplessMemoryPool<3> =
|
let mut heapless_pool: StaticHeaplessMemoryPool<3> =
|
||||||
StaticHeaplessMemoryPool::new(false);
|
StaticHeaplessMemoryPool::new(false);
|
||||||
assert!(
|
|
||||||
heapless_pool
|
heapless_pool
|
||||||
.grow(
|
.grow(
|
||||||
SUBPOOL_1.take(),
|
[<$prefix _SUBPOOL_1>].take(),
|
||||||
unsafe { &mut *SUBPOOL_1_SIZES.lock().unwrap().get() },
|
unsafe { &mut *[<$prefix _SUBPOOL_1_SIZES>].lock().unwrap().get() },
|
||||||
SUBPOOL_1_NUM_ELEMENTS,
|
SUBPOOL_1_NUM_ELEMENTS,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
.is_ok()
|
.unwrap();
|
||||||
);
|
|
||||||
assert!(
|
|
||||||
heapless_pool
|
heapless_pool
|
||||||
.grow(
|
.grow(
|
||||||
SUBPOOL_2.take(),
|
[<$prefix _SUBPOOL_2>].take(),
|
||||||
SUBPOOL_2_SIZES.take(),
|
[<$prefix _SUBPOOL_2_SIZES>].take(),
|
||||||
SUBPOOL_2_NUM_ELEMENTS,
|
SUBPOOL_2_NUM_ELEMENTS,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
.is_ok()
|
.unwrap();
|
||||||
);
|
|
||||||
assert!(
|
|
||||||
heapless_pool
|
heapless_pool
|
||||||
.grow(
|
.grow(
|
||||||
SUBPOOL_3.take(),
|
[<$prefix _SUBPOOL_3>].take(),
|
||||||
SUBPOOL_3_SIZES.take(),
|
[<$prefix _SUBPOOL_3_SIZES>].take(),
|
||||||
SUBPOOL_3_NUM_ELEMENTS,
|
SUBPOOL_3_NUM_ELEMENTS,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
.is_ok()
|
.unwrap();
|
||||||
);
|
|
||||||
heapless_pool
|
heapless_pool
|
||||||
}
|
}
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_heapless_add_and_read() {
|
fn test_heapless_add_and_read() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T0);
|
||||||
generic_test_add_and_read::<16>(&mut pool_provider);
|
generic_test_add_and_read::<16>(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_add_smaller_than_full_slot() {
|
fn test_add_smaller_than_full_slot() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T1);
|
||||||
generic_test_add_smaller_than_full_slot(&mut pool_provider);
|
generic_test_add_smaller_than_full_slot(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delete() {
|
fn test_delete() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T2);
|
||||||
generic_test_delete(&mut pool_provider);
|
generic_test_delete(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_modify() {
|
fn test_modify() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T3);
|
||||||
generic_test_modify(&mut pool_provider);
|
generic_test_modify(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_consecutive_reservation() {
|
fn test_consecutive_reservation() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T4);
|
||||||
generic_test_consecutive_reservation(&mut pool_provider);
|
generic_test_consecutive_reservation(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_read_does_not_exist() {
|
fn test_read_does_not_exist() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T5);
|
||||||
generic_test_read_does_not_exist(&mut pool_provider);
|
generic_test_read_does_not_exist(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_store_full() {
|
fn test_store_full() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T6);
|
||||||
generic_test_store_full(&mut pool_provider);
|
generic_test_store_full(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_invalid_pool_idx() {
|
fn test_invalid_pool_idx() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T7);
|
||||||
generic_test_invalid_pool_idx(&mut pool_provider);
|
generic_test_invalid_pool_idx(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_invalid_packet_idx() {
|
fn test_invalid_packet_idx() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T8);
|
||||||
generic_test_invalid_packet_idx(&mut pool_provider);
|
generic_test_invalid_packet_idx(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_add_too_large() {
|
fn test_add_too_large() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T9);
|
||||||
generic_test_add_too_large(&mut pool_provider);
|
generic_test_add_too_large(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_data_too_large_1() {
|
fn test_data_too_large_1() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T10);
|
||||||
generic_test_data_too_large_1(&mut pool_provider);
|
generic_test_data_too_large_1(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_free_element_too_large() {
|
fn test_free_element_too_large() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T11);
|
||||||
generic_test_free_element_too_large(&mut pool_provider);
|
generic_test_free_element_too_large(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pool_guard_deletion_man_creation() {
|
fn test_pool_guard_deletion_man_creation() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T12);
|
||||||
generic_test_pool_guard_deletion_man_creation(&mut pool_provider);
|
generic_test_pool_guard_deletion_man_creation(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pool_guard_deletion() {
|
fn test_pool_guard_deletion() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T13);
|
||||||
generic_test_pool_guard_deletion(&mut pool_provider);
|
generic_test_pool_guard_deletion(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pool_guard_with_release() {
|
fn test_pool_guard_with_release() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T14);
|
||||||
generic_test_pool_guard_with_release(&mut pool_provider);
|
generic_test_pool_guard_with_release(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pool_modify_guard_man_creation() {
|
fn test_pool_modify_guard_man_creation() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T15);
|
||||||
generic_test_pool_modify_guard_man_creation(&mut pool_provider);
|
generic_test_pool_modify_guard_man_creation(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pool_modify_guard() {
|
fn test_pool_modify_guard() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T16);
|
||||||
generic_test_pool_modify_guard(&mut pool_provider);
|
generic_test_pool_modify_guard(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn modify_pool_index_above_0() {
|
fn modify_pool_index_above_0() {
|
||||||
let mut pool_provider = small_heapless_pool();
|
let mut pool_provider = make_heapless_pool!(T17);
|
||||||
generic_modify_pool_index_above_0(&mut pool_provider);
|
generic_modify_pool_index_above_0(&mut pool_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_spills_to_higher_subpools() {
|
fn test_spills_to_higher_subpools() {
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_2_T18,
|
||||||
|
SUBPOOL_2_SIZES_T18,
|
||||||
|
SUBPOOL_2_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_2_BLOCK_SIZE
|
||||||
|
);
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_4_T18,
|
||||||
|
SUBPOOL_4_SIZES_T18,
|
||||||
|
SUBPOOL_4_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_4_BLOCK_SIZE
|
||||||
|
);
|
||||||
let mut heapless_pool: StaticHeaplessMemoryPool<2> =
|
let mut heapless_pool: StaticHeaplessMemoryPool<2> =
|
||||||
StaticHeaplessMemoryPool::new(true);
|
StaticHeaplessMemoryPool::new(true);
|
||||||
assert!(
|
assert!(
|
||||||
heapless_pool
|
heapless_pool
|
||||||
.grow(
|
.grow(
|
||||||
SUBPOOL_2.take(),
|
SUBPOOL_2_T18.take(),
|
||||||
SUBPOOL_2_SIZES.take(),
|
SUBPOOL_2_SIZES_T18.take(),
|
||||||
SUBPOOL_2_NUM_ELEMENTS,
|
SUBPOOL_2_NUM_ELEMENTS,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
@@ -1822,8 +1828,8 @@ mod tests {
|
|||||||
assert!(
|
assert!(
|
||||||
heapless_pool
|
heapless_pool
|
||||||
.grow(
|
.grow(
|
||||||
SUBPOOL_4.take(),
|
SUBPOOL_4_T18.take(),
|
||||||
SUBPOOL_4_SIZES.take(),
|
SUBPOOL_4_SIZES_T18.take(),
|
||||||
SUBPOOL_4_NUM_ELEMENTS,
|
SUBPOOL_4_NUM_ELEMENTS,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
@@ -1836,6 +1842,18 @@ mod tests {
|
|||||||
fn test_spillage_fails_as_well() {
|
fn test_spillage_fails_as_well() {
|
||||||
let mut heapless_pool: StaticHeaplessMemoryPool<2> =
|
let mut heapless_pool: StaticHeaplessMemoryPool<2> =
|
||||||
StaticHeaplessMemoryPool::new(true);
|
StaticHeaplessMemoryPool::new(true);
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_5,
|
||||||
|
SUBPOOL_5_SIZES,
|
||||||
|
SUBPOOL_5_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_5_BLOCK_SIZE
|
||||||
|
);
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_3,
|
||||||
|
SUBPOOL_3_SIZES,
|
||||||
|
SUBPOOL_3_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_3_BLOCK_SIZE
|
||||||
|
);
|
||||||
assert!(
|
assert!(
|
||||||
heapless_pool
|
heapless_pool
|
||||||
.grow(
|
.grow(
|
||||||
@@ -1863,6 +1881,24 @@ mod tests {
|
|||||||
fn test_spillage_works_across_multiple_subpools() {
|
fn test_spillage_works_across_multiple_subpools() {
|
||||||
let mut heapless_pool: StaticHeaplessMemoryPool<3> =
|
let mut heapless_pool: StaticHeaplessMemoryPool<3> =
|
||||||
StaticHeaplessMemoryPool::new(true);
|
StaticHeaplessMemoryPool::new(true);
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_3,
|
||||||
|
SUBPOOL_3_SIZES,
|
||||||
|
SUBPOOL_3_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_3_BLOCK_SIZE
|
||||||
|
);
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_5,
|
||||||
|
SUBPOOL_5_SIZES,
|
||||||
|
SUBPOOL_5_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_5_BLOCK_SIZE
|
||||||
|
);
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_6,
|
||||||
|
SUBPOOL_6_SIZES,
|
||||||
|
SUBPOOL_6_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_6_BLOCK_SIZE
|
||||||
|
);
|
||||||
assert!(
|
assert!(
|
||||||
heapless_pool
|
heapless_pool
|
||||||
.grow(
|
.grow(
|
||||||
@@ -1898,6 +1934,24 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_spillage_fails_across_multiple_subpools() {
|
fn test_spillage_fails_across_multiple_subpools() {
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_3,
|
||||||
|
SUBPOOL_3_SIZES,
|
||||||
|
SUBPOOL_3_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_3_BLOCK_SIZE
|
||||||
|
);
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_5,
|
||||||
|
SUBPOOL_5_SIZES,
|
||||||
|
SUBPOOL_5_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_5_BLOCK_SIZE
|
||||||
|
);
|
||||||
|
static_subpool!(
|
||||||
|
SUBPOOL_6,
|
||||||
|
SUBPOOL_6_SIZES,
|
||||||
|
SUBPOOL_6_NUM_ELEMENTS as usize,
|
||||||
|
SUBPOOL_6_BLOCK_SIZE
|
||||||
|
);
|
||||||
let mut heapless_pool: StaticHeaplessMemoryPool<3> =
|
let mut heapless_pool: StaticHeaplessMemoryPool<3> =
|
||||||
StaticHeaplessMemoryPool::new(true);
|
StaticHeaplessMemoryPool::new(true);
|
||||||
assert!(
|
assert!(
|
||||||
|
|||||||
Reference in New Issue
Block a user