MCPcopy Create free account
hub / github.com/WasmVM/WasmVM / mem_write

Function mem_write

host/sysenv/sysenv.cpp:90–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void mem_write(Stack& stack, i64_t ptr, const void* src, size_t len) {
91 MemInst& mem = get_mem(stack, ptr);
92 size_t off = (size_t)((uint64_t)ptr & PTR_OFF_MASK);
93 size_t end = off + len;
94 if(end > mem.data.size()) {
95 throw std::out_of_range("sysenv: memory write out of bounds");
96 }
97 std::memcpy(mem.data.data() + off, src, len);
98}
99
100// ---- reg_func helper --------------------------------------------------------
101

Callers 5

write_wasm_statFunction · 0.85
fs_readdirFunction · 0.85
proc_argvFunction · 0.85
proc_getenvFunction · 0.85
proc_clock_gettimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected