Skip to content

Commit cb0cac2

Browse files
authored
cranelift-entity: Add a method to pre-reserve capacity to EntitySet (bytecodealliance#9069)
Just exposing functionality that already exists in the underlying bitset implementation. Will be used in a follow-up pull request.
1 parent 29d6fcc commit cb0cac2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cranelift/entity/src/set.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ where
5353
}
5454
}
5555

56+
/// Ensure that the set has enough capacity to hold `capacity` total
57+
/// elements.
58+
pub fn ensure_capacity(&mut self, capacity: usize) {
59+
self.bitset.ensure_capacity(capacity);
60+
}
61+
5662
/// Get the element at `k` if it exists.
5763
pub fn contains(&self, k: K) -> bool {
5864
let index = k.index();

0 commit comments

Comments
 (0)