| 3533 | } |
| 3534 | |
| 3535 | void 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 | |
| 3557 | WASMEDGE_CAPI_EXPORT uint32_t |
| 3558 | WasmEdge_VMGetFunctionListLength(const WasmEdge_VMContext *Cxt) noexcept { |