Host function to erase std::map by key.
| 231 | |
| 232 | // Host function to erase std::map<std::string, std::string> by key. |
| 233 | WasmEdge_Result ExternSTLMapErase(void *, const WasmEdge_CallingFrameContext *, |
| 234 | const WasmEdge_Value *In, WasmEdge_Value *) { |
| 235 | // Function type: {externref, externref} -> {} |
| 236 | void *Ptr0 = WasmEdge_ValueGetExternRef(In[0]); |
| 237 | void *Ptr1 = WasmEdge_ValueGetExternRef(In[1]); |
| 238 | auto &Map = *reinterpret_cast<std::map<std::string, std::string> *>(Ptr0); |
| 239 | auto &Key = *reinterpret_cast<std::string *>(Ptr1); |
| 240 | Map.erase(Key); |
| 241 | return WasmEdge_Result_Success; |
| 242 | } |
| 243 | |
| 244 | // Host function to insert a key into std::set<uint32_t>. |
| 245 | WasmEdge_Result ExternSTLSetInsert(void *, const WasmEdge_CallingFrameContext *, |
nothing calls this directly
no test coverage detected