alexcrichton commented on issue #985:
Fixed in https://github.com/bytecodealliance/wasmtime/pull/3023
alexcrichton closed issue #985:
We have two copies of all of our runtime functions that implement memory-related instructions (eg
memory.size
,memory.grow
,memory.init
, andmemory.copy
):
- A version for locally defined memories
- A version for imported memories
Having two different impls isn't a speed win because the tiny bit of specialization is definitely dwarfed by the cost of an indirect library function call.
We just don't currently have a nice way to get a memory regardless if it is imported or locally defined given a
MemoryIndex
. That is easy enough to do, we haveInstance::get_table
that does exactly this for tables rather than memories, and we can do a similar thing for memories.
Last updated: Dec 23 2024 at 12:05 UTC