MCPcopy Create free account
hub / github.com/go-python/gopy / IncRef

Function IncRef

gopyh/handle.go:163–177  ·  view source on GitHub ↗

IncRef increments the reference count for the specified handle.

(handle CGoHandle)

Source from the content-addressed store, hash-verified

161
162// IncRef increments the reference count for the specified handle.
163func IncRef(handle CGoHandle) {
164 if handle < 1 {
165 return
166 }
167 mu.Lock()
168 defer mu.Unlock()
169 ghc := GoHandle(handle)
170 if _, exists := counts[ghc]; exists {
171 counts[ghc]++
172 if trace {
173 fmt.Printf("gopy IncRef: %d: %d\n", handle, counts[ghc])
174 }
175 }
176
177}
178
179// VarFromHandle gets variable from handle string.
180// Reports error to python but does not return it,

Callers

nothing calls this directly

Calls 2

GoHandleTypeAlias · 0.85
PrintfMethod · 0.80

Tested by

no test coverage detected