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

Function push_flags

crates/wasmtime/src/runtime/component/values.rs:1144–1152  ·  view source on GitHub ↗
(ty: &TypeFlags, flags: &mut Vec<String>, mut offset: u32, mut bits: u32)

Source from the content-addressed store, hash-verified

1142}
1143
1144fn push_flags(ty: &TypeFlags, flags: &mut Vec<String>, mut offset: u32, mut bits: u32) {
1145 while bits > 0 && usize::try_from(offset).unwrap() < ty.names.len() {
1146 if bits & 1 != 0 {
1147 flags.push(ty.names[offset as usize].clone());
1148 }
1149 bits >>= 1;
1150 offset += 1;
1151 }
1152}
1153
1154fn flags_to_storage(ty: &TypeFlags, flags: &[String]) -> Result<Vec<u32>> {
1155 let mut storage = match FlagsSize::from_count(ty.names.len()) {

Callers 2

liftMethod · 0.85
loadMethod · 0.85

Calls 4

unwrapMethod · 0.45
lenMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected