Creates a new host-defined memory with the type specified.
| 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 { |
nothing calls this directly
no test coverage detected