| 2103 | // >>>>>>>> WasmEdge executor functions >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
| 2104 | |
| 2105 | WASMEDGE_CAPI_EXPORT WasmEdge_ExecutorContext * |
| 2106 | WasmEdge_ExecutorCreate(const WasmEdge_ConfigureContext *ConfCxt, |
| 2107 | WasmEdge_StatisticsContext *StatCxt) noexcept { |
| 2108 | try { |
| 2109 | if (ConfCxt) { |
| 2110 | if (StatCxt) { |
| 2111 | return toExecutorCxt(new WasmEdge::Executor::Executor( |
| 2112 | ConfCxt->Conf, fromStatCxt(StatCxt))); |
| 2113 | } else { |
| 2114 | return toExecutorCxt(new WasmEdge::Executor::Executor(ConfCxt->Conf)); |
| 2115 | } |
| 2116 | } else { |
| 2117 | if (StatCxt) { |
| 2118 | return toExecutorCxt(new WasmEdge::Executor::Executor( |
| 2119 | WasmEdge::Configure(), fromStatCxt(StatCxt))); |
| 2120 | } else { |
| 2121 | return toExecutorCxt( |
| 2122 | new WasmEdge::Executor::Executor(WasmEdge::Configure())); |
| 2123 | } |
| 2124 | } |
| 2125 | } catch (...) { |
| 2126 | handleCAPIError(); |
| 2127 | return nullptr; |
| 2128 | } |
| 2129 | } |
| 2130 | |
| 2131 | WASMEDGE_CAPI_EXPORT WasmEdge_Result WasmEdge_ExecutorInstantiate( |
| 2132 | WasmEdge_ExecutorContext *Cxt, WasmEdge_ModuleInstanceContext **ModuleCxt, |