Adds MemoryDefinition to CompiledModule and Memory (#817)
It is more often the case that projects are enabling a freestanding target, and that may or may not have an exporting memory depending on how that's interpreted. This adds the ability to inspect memories similar to how you can already inspect compiled code prior to instantiation. For example, you can enforce an ABI constraint that "memory" must be exported even if WASI is not in use. Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -181,8 +181,9 @@ func (r *runtime) CompileModule(ctx context.Context, binary []byte) (CompiledMod
|
||||
|
||||
internal.AssignModuleID(binary)
|
||||
|
||||
// Now that the module is validated, cache the function definitions.
|
||||
// Now that the module is validated, cache the function and memory definitions.
|
||||
internal.BuildFunctionDefinitions()
|
||||
internal.BuildMemoryDefinitions()
|
||||
|
||||
c := &compiledModule{module: internal, compiledEngine: r.store.Engine}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user