| 2733 | // >>>>>>>> WasmEdge table instance functions >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
| 2734 | |
| 2735 | WASMEDGE_CAPI_EXPORT WasmEdge_TableInstanceContext * |
| 2736 | WasmEdge_TableInstanceCreate( |
| 2737 | const WasmEdge_TableTypeContext *TabType) noexcept { |
| 2738 | try { |
| 2739 | if (TabType) { |
| 2740 | const AST::TableType &TType = *fromTabTypeCxt(TabType); |
| 2741 | if (!TType.getRefType().isNullableRefType()) { |
| 2742 | spdlog::error(WasmEdge::ErrCode::Value::NonNullRequired); |
| 2743 | return nullptr; |
| 2744 | } |
| 2745 | return toTabCxt(new WasmEdge::Runtime::Instance::TableInstance(TType)); |
| 2746 | } |
| 2747 | } catch (...) { |
| 2748 | handleCAPIError(); |
| 2749 | } |
| 2750 | return nullptr; |
| 2751 | } |
| 2752 | |
| 2753 | WASMEDGE_CAPI_EXPORT extern WasmEdge_TableInstanceContext * |
| 2754 | WasmEdge_TableInstanceCreateWithInit(const WasmEdge_TableTypeContext *TabType, |