Closed alexcrichton closed 4 years ago
The API uniformly requires a store argument for every allocation operation. Depending on an engine's implementation choices, this could be extracted from other arguments in some cases, but that would potentially impose unnecessary constraints on implementations.
For example, in V8, the store corresponds directly to an isolate. It is a convention in the engine to pass an isolate to every internal operation that needs it. There is a way to get to the home isolate from heap objects, but it is expensive and partial, and thus considered more or less deprecated.
Ok, sounds like this'll be sticking around then!
Currently
wasm_instance_new
takes awasm_store_t
parameter as its first argument, but the secondwasm_module_t
argument was already created within a store and presumably this parameter could be inferred. Is this intended, though, to perhaps put instance cached data in one place and module cached data in another place?