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

Function WasmEdge_VMForceDeleteRegisteredModule

lib/api/wasmedge.cpp:3535–3555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3533}
3534
3535void WasmEdge_VMForceDeleteRegisteredModule(
3536 const WasmEdge_VMContext *Cxt, const WasmEdge_String ModuleName) noexcept {
3537 if (!Cxt || !ModuleName.Buf) {
3538 return; // Invalid input
3539 }
3540
3541 // Cast away const to match WasmEdge_VMGetStoreContext signature
3542 WasmEdge_StoreContext *StoreCxt =
3543 WasmEdge_VMGetStoreContext(const_cast<WasmEdge_VMContext *>(Cxt));
3544 if (!StoreCxt) {
3545 return; // Invalid store context
3546 }
3547
3548 const WasmEdge_ModuleInstanceContext *ModInst =
3549 WasmEdge_StoreFindModule(StoreCxt, ModuleName);
3550 if (ModInst) {
3551 fromStoreCxt(StoreCxt)->unregisterModule(genStrView(ModuleName));
3552 WasmEdge_ModuleInstanceDelete(
3553 const_cast<WasmEdge_ModuleInstanceContext *>(ModInst));
3554 }
3555}
3556
3557WASMEDGE_CAPI_EXPORT uint32_t
3558WasmEdge_VMGetFunctionListLength(const WasmEdge_VMContext *Cxt) noexcept {

Callers 1

TESTFunction · 0.85

Calls 5

WasmEdge_StoreFindModuleFunction · 0.85
genStrViewFunction · 0.85
unregisterModuleMethod · 0.80

Tested by 1

TESTFunction · 0.68