Host function to push a value into std::vector .
| 263 | |
| 264 | // Host function to push a value into std::vector<uint32_t>. |
| 265 | WasmEdge_Result ExternSTLVectorPush(void *, |
| 266 | const WasmEdge_CallingFrameContext *, |
| 267 | const WasmEdge_Value *In, |
| 268 | WasmEdge_Value *) { |
| 269 | // Function type: {externref, i32} -> {} |
| 270 | void *Ptr = WasmEdge_ValueGetExternRef(In[0]); |
| 271 | auto &Vec = *reinterpret_cast<std::vector<uint32_t> *>(Ptr); |
| 272 | Vec.push_back(static_cast<uint32_t>(WasmEdge_ValueGetI32(In[1]))); |
| 273 | return WasmEdge_Result_Success; |
| 274 | } |
| 275 | |
| 276 | // Host function to sum values in a slice of std::vector<uint32_t>. |
| 277 | WasmEdge_Result ExternSTLVectorSum(void *, const WasmEdge_CallingFrameContext *, |
nothing calls this directly
no test coverage detected