Proper way to 'unload' a loaded wasm module #1301
-
What would be the proper/optimum way to 'unload' or 'drop' a module with the intent to load a different module. e.g.
Since 'almost' everything keeps a hierarchy of references I'm unsure what would be most efficient i.e. freeing the right resources without unnecessary re-initialization. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can load multiple modules using the same Wasmi So if it is important to unload a Wasmi |
Beta Was this translation helpful? Give feedback.
You can load multiple modules using the same Wasmi
Engine
. WasmiEngine
mostly holds information about a module's function code. All other information is stored in theStore
. You are right that it is currently not possible to "unload" a Wasm module from anEngine
. This has technical reasons. If this use case is common enough we might be able to add this functionality.So if it is important to unload a Wasmi
Module
you'd need to dropModule
,Store
andLinker
.