This commit is contained in:
nora 2022-08-20 22:13:11 +02:00
parent 4b76492f78
commit f725efa471
2 changed files with 8 additions and 6 deletions

View file

@ -112,7 +112,7 @@ impl RootNode {
let block_ref_ptr = current_block.as_ptr();
let block_ref = block_ref_ptr.read();
if block_ref.size <= size {
if size <= block_ref.size {
// rewire the link to skip the current node
prev_next_ptr.write(block_ref.next_free_block);
(*block_ref_ptr).next_free_block = None;

View file

@ -15,11 +15,12 @@ fn boxed() {
}
#[test]
#[ignore]
fn vec() {
let mut vec = Vec::new();
for i in 0..10_000 {
let len = if cfg!(miri) { 100 } else { 10_000 };
for i in 0..len {
vec.push(i);
}
@ -27,11 +28,12 @@ fn vec() {
}
#[test]
#[ignore]
fn btree_map() {
let mut map = BTreeMap::new();
for i in (0..1000).map(|i| i * 3) {
let len = if cfg!(miri) { 10 } else { 1000 };
for i in (0..len).map(|i| i * 3) {
map.insert(i, i + 10);
}