| 2043 | } |
| 2044 | |
| 2045 | WASMEDGE_CAPI_EXPORT WasmEdge_Result WasmEdge_LoaderSerializeASTModule( |
| 2046 | WasmEdge_LoaderContext *Cxt, const WasmEdge_ASTModuleContext *ASTCxt, |
| 2047 | WasmEdge_Bytes *Buf) noexcept { |
| 2048 | return wrap( |
| 2049 | [&]() { |
| 2050 | return fromLoaderCxt(Cxt)->serializeModule(*fromASTModCxt(ASTCxt)); |
| 2051 | }, |
| 2052 | [&](auto &&Res) { |
| 2053 | uint32_t Size = static_cast<uint32_t>((*Res).size()); |
| 2054 | uint8_t *Bytes = new uint8_t[Size]; |
| 2055 | std::copy_n((*Res).begin(), Size, Bytes); |
| 2056 | Buf->Length = Size; |
| 2057 | Buf->Buf = Bytes; |
| 2058 | }, |
| 2059 | Cxt, ASTCxt, Buf); |
| 2060 | } |
| 2061 | |
| 2062 | WASMEDGE_CAPI_EXPORT void |
| 2063 | WasmEdge_LoaderDelete(WasmEdge_LoaderContext *Cxt) noexcept { |
nothing calls this directly
no test coverage detected