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

Method expand_to

cranelift/codegen/src/ir/constant.rs:108–114  ·  view source on GitHub ↗

Expand the size of the constant data to `expected_size` number of bytes by adding zeroes in the high-order byte slots.

(mut self, expected_size: usize)

Source from the content-addressed store, hash-verified

106 /// Expand the size of the constant data to `expected_size` number of bytes by adding zeroes
107 /// in the high-order byte slots.
108 pub fn expand_to(mut self, expected_size: usize) -> Self {
109 if self.len() > expected_size {
110 panic!("The constant data is already expanded beyond {expected_size} bytes")
111 }
112 self.0.resize(expected_size, 0);
113 self
114 }
115}
116
117impl fmt::Display for ConstantData {

Callers 3

match_uimm128Method · 0.80
parse_to_uimm128Function · 0.80

Calls 2

lenMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected