MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / instantiateModule

Function instantiateModule

test/api/APIUnitTest.cpp:430–439  ·  view source on GitHub ↗

Helper function to instantiate module.

Source from the content-addressed store, hash-verified

428
429// Helper function to instantiate module.
430WasmEdge_ModuleInstanceContext *
431instantiateModule(const WasmEdge_ConfigureContext *Conf,
432 WasmEdge_StoreContext *Store,
433 const WasmEdge_ASTModuleContext *Mod) {
434 WasmEdge_ExecutorContext *ExecCxt = WasmEdge_ExecutorCreate(Conf, nullptr);
435 WasmEdge_ModuleInstanceContext *ResMod = nullptr;
436 WasmEdge_ExecutorInstantiate(ExecCxt, &ResMod, Store, Mod);
437 WasmEdge_ExecutorDelete(ExecCxt);
438 return ResMod;
439}
440
441// Helper function to read file into a buffer.
442bool readToVector(const char *Path, std::vector<uint8_t> &Buf) {

Callers 1

TESTFunction · 0.85

Calls 2

WasmEdge_ExecutorCreateFunction · 0.85
WasmEdge_ExecutorDeleteFunction · 0.85

Tested by

no test coverage detected