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

Function sclass_for_length

cranelift/entity/src/list.rs:128–130  ·  view source on GitHub ↗
(len: usize)

Source from the content-addressed store, hash-verified

126/// This always leaves room for the length element in addition to the list elements.
127#[inline]
128fn sclass_for_length(len: usize) -> SizeClass {
129 30 - (len as u32 | 3).leading_zeros() as SizeClass
130}
131
132/// Is `len` the minimum length in its size class?
133#[inline]

Callers 7

from_sliceMethod · 0.85
deep_cloneMethod · 0.85
clearMethod · 0.85
pushMethod · 0.85
growMethod · 0.85
remove_lastMethod · 0.85
truncateMethod · 0.85

Calls 1

leading_zerosMethod · 0.80

Tested by

no test coverage detected