MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / ExternSTLSetErase

Function ExternSTLSetErase

test/externref/ExternrefTest.cpp:255–262  ·  view source on GitHub ↗

Host function to erase std::set by key.

Source from the content-addressed store, hash-verified

253
254// Host function to erase std::set<uint32_t> by key.
255WasmEdge_Result ExternSTLSetErase(void *, const WasmEdge_CallingFrameContext *,
256 const WasmEdge_Value *In, WasmEdge_Value *) {
257 // Function type: {externref, i32} -> {}
258 void *Ptr = WasmEdge_ValueGetExternRef(In[0]);
259 auto &Set = *reinterpret_cast<std::set<uint32_t> *>(Ptr);
260 Set.erase(static_cast<uint32_t>(WasmEdge_ValueGetI32(In[1])));
261 return WasmEdge_Result_Success;
262}
263
264// Host function to push a value into std::vector<uint32_t>.
265WasmEdge_Result ExternSTLVectorPush(void *,

Callers

nothing calls this directly

Calls 3

WasmEdge_ValueGetI32Function · 0.85
eraseMethod · 0.80

Tested by

no test coverage detected