Host function to insert a key into std::set .
| 243 | |
| 244 | // Host function to insert a key into std::set<uint32_t>. |
| 245 | WasmEdge_Result ExternSTLSetInsert(void *, const WasmEdge_CallingFrameContext *, |
| 246 | const WasmEdge_Value *In, WasmEdge_Value *) { |
| 247 | // Function type: {externref, i32} -> {} |
| 248 | void *Ptr = WasmEdge_ValueGetExternRef(In[0]); |
| 249 | auto &Set = *reinterpret_cast<std::set<uint32_t> *>(Ptr); |
| 250 | Set.insert(static_cast<uint32_t>(WasmEdge_ValueGetI32(In[1]))); |
| 251 | return WasmEdge_Result_Success; |
| 252 | } |
| 253 | |
| 254 | // Host function to erase std::set<uint32_t> by key. |
| 255 | WasmEdge_Result ExternSTLSetErase(void *, const WasmEdge_CallingFrameContext *, |
nothing calls this directly
no test coverage detected