- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for SetFinalizer (0.07 sec)
-
cni/pkg/nodeagent/pod_cache.go
defer p.mu.Unlock() if _, ok := p.currentPodCache[uid]; !ok { p.currentPodCache[uid] = WorkloadInfo{} } } func (p *podNetnsCache) addToCacheUnderLock(uid string, workload WorkloadInfo) { runtime.SetFinalizer(workload.Netns, closeNetns) p.currentPodCache[uid] = workload } func closeNetns(netns NetnsCloser) { netns.Close() } func (p *podNetnsCache) ReadCurrentPodSnapshot() map[string]WorkloadInfo {
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Fri May 31 17:18:11 UTC 2024 - 4.3K bytes - Viewed (0) -
istioctl/pkg/analyze/analyze.go
} } return readers, nil } func gatherFile(f string) (local.ReaderSource, error) { r, err := os.Open(f) if err != nil { return local.ReaderSource{}, err } runtime.SetFinalizer(r, func(x *os.File) { err = x.Close() if err != nil { log.Infof("file : %s is not closed: %v", f, err) } }) return local.ReaderSource{Name: f, Reader: r}, nil }
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Thu Oct 31 06:53:50 UTC 2024 - 17.6K bytes - Viewed (0) -
misc/cgo/gmp/gmp.go
have pointers into the C world and to free those pointers when they are no longer needed. To help, the Go code can define Go objects holding the C pointers and use runtime.SetFinalizer on those Go objects. It is much more difficult for the C world to have pointers into the Go world, because the Go garbage collector is unaware of the memory allocated by C. The most important consideration is not to
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Mon Apr 11 16:34:30 UTC 2022 - 9.5K bytes - Viewed (0) -
doc/go_mem.html
</p> <h3 id="finalizer">Finalizers</h3> <p> The <a href="/pkg/runtime/"><code>runtime</code></a> package provides a <code>SetFinalizer</code> function that adds a finalizer to be called when a particular object is no longer reachable by the program. A call to <code>SetFinalizer(x, f)</code> is synchronized before the finalization call <code>f(x)</code>. </p> <h3 id="more">Additional Mechanisms</h3> <p>
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Mon Mar 04 15:54:42 UTC 2024 - 26.6K bytes - Viewed (0)