MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / capacity

Method capacity

cranelift/bitset/src/compound.rs:162–164  ·  view source on GitHub ↗

Get `n + 1` where `n` is the largest value that can be stored inside this set without growing the backing storage. That is, this set can store any value `x` such that `x < bitset.capacity()` without growing the backing storage. # Example ``` use cranelift_bitset::CompoundBitSet; let mut bitset = CompoundBitSet::new(); // New bitsets have zero capacity -- they allocate lazily. assert_eq!(bitse

(&self)

Source from the content-addressed store, hash-verified

160 /// assert!(bitset.capacity() >= 999);
161 ///```
162 pub fn capacity(&self) -> usize {
163 self.elems.len() * Self::BITS_PER_SCALAR
164 }
165
166 /// Is this bitset empty?
167 ///

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected