Skip to content

Commit eca9f14

Browse files
committed
Also test when old capacity is not a multiple of our alignment
1 parent e839118 commit eca9f14

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/wasmtime/src/runtime/vm/gc/enabled/free_list.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,13 @@ mod tests {
860860
"still not enough capacity because we won't allocate the zero index"
861861
);
862862

863-
free_list.add_capacity(ALIGN_USIZE);
863+
free_list.add_capacity(1);
864+
assert!(
865+
free_list.alloc(layout).unwrap().is_none(),
866+
"still not enough capacity because allocations are multiples of the alignment"
867+
);
868+
869+
free_list.add_capacity(ALIGN_USIZE - 1);
864870
let a = free_list
865871
.alloc(layout)
866872
.unwrap()

0 commit comments

Comments
 (0)