spacewasm_mem_read, spacewasm_mem_write and spacewasm_mem_size all take a spacewasm_caller_t * (include/spacewasm.h:808-832), which only exists inside a host-function callback. From the embedder's side of spacewasm_invoke/spacewasm_run there is no way to touch linear memory: a component cannot stage an input buffer before invoking a guest function, or read a result buffer after spacewasm_run returns, without routing it through an extra host call. The Rust side has this (Engine::memory; Memory::load/store/size/grow in src/memory.rs:167-300).
Would an engine-level counterpart be welcome, e.g. spacewasm_engine_mem_read/_write/_size taking spacewasm_t * with the same bounds-checked semantics, plus grow? If so I can send it as a PR in crates/spacewasm_c_api with C tests in spacewasm_c_example; opening this first per CONTRIBUTING.md.
AI use per AI_POLICY.md: Claude Code assisted with reviewing the header and drafting this issue.
spacewasm_mem_read,spacewasm_mem_writeandspacewasm_mem_sizeall take aspacewasm_caller_t *(include/spacewasm.h:808-832), which only exists inside a host-function callback. From the embedder's side ofspacewasm_invoke/spacewasm_runthere is no way to touch linear memory: a component cannot stage an input buffer before invoking a guest function, or read a result buffer afterspacewasm_runreturns, without routing it through an extra host call. The Rust side has this (Engine::memory;Memory::load/store/size/growinsrc/memory.rs:167-300).Would an engine-level counterpart be welcome, e.g.
spacewasm_engine_mem_read/_write/_sizetakingspacewasm_t *with the same bounds-checked semantics, plusgrow? If so I can send it as a PR incrates/spacewasm_c_apiwith C tests inspacewasm_c_example; opening this first perCONTRIBUTING.md.AI use per
AI_POLICY.md: Claude Code assisted with reviewing the header and drafting this issue.