MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / Get

Method Get

linker.go:286–306  ·  view source on GitHub ↗

GetOneByName loads an item by name from this linker. If the item isn't defined then nil is returned, otherwise the item is returned.

(store Storelike, module, name string)

Source from the content-addressed store, hash-verified

284// If the item isn't defined then nil is returned, otherwise the item is
285// returned.
286func (l *Linker) Get(store Storelike, module, name string) *Extern {
287 var ret C.wasmtime_extern_t
288 ok := C.wasmtime_linker_get(
289 l.ptr(),
290 store.Context(),
291 C._GoStringPtr(module),
292 C._GoStringLen(module),
293 C._GoStringPtr(name),
294 C._GoStringLen(name),
295 &ret,
296 )
297 runtime.KeepAlive(l)
298 runtime.KeepAlive(name)
299 runtime.KeepAlive(module)
300 runtime.KeepAlive(store)
301 if ok {
302 return mkExtern(&ret)
303 }
304 return nil
305
306}

Callers 1

TestLinkerGetOneByNameFunction · 0.95

Calls 3

ptrMethod · 0.95
mkExternFunction · 0.85
ContextMethod · 0.65

Tested by 1

TestLinkerGetOneByNameFunction · 0.76