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

Method create

crates/c-api/include/wasmtime/memory.hh:36–43  ·  view source on GitHub ↗

Creates a new host-defined memory with the type specified.

Source from the content-addressed store, hash-verified

34
35 /// Creates a new host-defined memory with the type specified.
36 static Result<Memory> create(Store::Context cx, const MemoryType &ty) {
37 wasmtime_memory_t memory;
38 auto *error = wasmtime_memory_new(cx.ptr, ty.ptr.get(), &memory);
39 if (error != nullptr) {
40 return Error(error);
41 }
42 return Memory(memory);
43 }
44
45 /// Returns the type of this memory.
46 MemoryType type(Store::Context cx) const {

Callers

nothing calls this directly

Calls 4

wasmtime_memory_newFunction · 0.85
ErrorClass · 0.70
MemoryClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected