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

Method as_slice

cranelift/codegen/src/machinst/vcode.rs:1937–1943  ·  view source on GitHub ↗

Retrieve the constant data as a byte slice.

(&self)

Source from the content-addressed store, hash-verified

1935impl VCodeConstantData {
1936 /// Retrieve the constant data as a byte slice.
1937 pub fn as_slice(&self) -> &[u8] {
1938 match self {
1939 VCodeConstantData::Pool(_, d) | VCodeConstantData::Generated(d) => d.as_slice(),
1940 VCodeConstantData::WellKnown(d) => d,
1941 VCodeConstantData::U64(value) => &value[..],
1942 }
1943 }
1944
1945 /// Calculate the alignment of the constant data.
1946 pub fn alignment(&self) -> u32 {

Callers 4

register_constantMethod · 0.45
finish_constantsMethod · 0.45
from_func_sigMethod · 0.45
alignmentMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected