MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / lower_to_memory

Function lower_to_memory

crates/core/src/abi.rs:822–837  ·  view source on GitHub ↗
(
    resolve: &Resolve,
    bindgen: &mut B,
    address: B::Operand,
    value: B::Operand,
    ty: &Type,
)

Source from the content-addressed store, hash-verified

820}
821
822pub fn lower_to_memory<B: Bindgen>(
823 resolve: &Resolve,
824 bindgen: &mut B,
825 address: B::Operand,
826 value: B::Operand,
827 ty: &Type,
828) {
829 let mut generator = Generator::new(resolve, bindgen);
830 // TODO: make this configurable? Right now this function is only called for
831 // future/stream callbacks so it's appropriate to skip realloc here as it's
832 // all "lower for wasm import", but this might get reused for something else
833 // in the future.
834 generator.realloc = Some(Realloc::Export("cabi_realloc"));
835 generator.stack.push(value);
836 generator.write_to_memory(ty, address, Default::default());
837}
838
839pub fn lower_flat<B: Bindgen>(
840 resolve: &Resolve,

Callers 6

callMethod · 0.85
lower_to_memoryMethod · 0.85
future_or_streamMethod · 0.85
importMethod · 0.85
lower_to_memoryMethod · 0.85
lower_to_memoryMethod · 0.85

Calls 3

newFunction · 0.85
write_to_memoryMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected