MCPcopy Create free account
hub / github.com/buke/quickjs-go / getRuntimeFromJS

Function getRuntimeFromJS

bridge_mapping.go:57–71  ·  view source on GitHub ↗

getRuntimeFromJS gets Go Runtime from C JSRuntime (internal use).

(cRt *C.JSRuntime)

Source from the content-addressed store, hash-verified

55
56// getRuntimeFromJS gets Go Runtime from C JSRuntime (internal use).
57func getRuntimeFromJS(cRt *C.JSRuntime) *Runtime {
58 if value, ok := runtimeMapping.Load(cRt); ok {
59 rt, ok := value.(*Runtime)
60 if !ok {
61 runtimeMapping.Delete(cRt)
62 return nil
63 }
64 if !rt.isAlive() {
65 runtimeMapping.Delete(cRt)
66 return nil
67 }
68 return rt
69 }
70 return nil
71}

Calls 3

LoadMethod · 0.80
DeleteMethod · 0.45
isAliveMethod · 0.45