diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-06 18:43:04 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-06 18:43:04 +0000 |
commit | cb5b8404870548b61ce243c24be04e810f91fc70 (patch) | |
tree | d14bc22dad746af3753d01bfb6fa3cba0c0d5995 /pkg/refs | |
parent | 7b5a689d9031106fdf5c4a3f9dacec26eee9c9dc (diff) | |
parent | b918d97850075cc353abf7b590b4e807e2984ab0 (diff) |
Merge release-20200804.0-33-gb918d9785 (automated)
Diffstat (limited to 'pkg/refs')
-rw-r--r-- | pkg/refs/refcounter.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/refs/refcounter.go b/pkg/refs/refcounter.go index 61790221b..3f39edb66 100644 --- a/pkg/refs/refcounter.go +++ b/pkg/refs/refcounter.go @@ -215,6 +215,8 @@ type AtomicRefCount struct { // LeakMode configures the leak checker. type LeakMode uint32 +// TODO(gvisor.dev/issue/1624): Simplify down to two modes once vfs1 ref +// counting is gone. const ( // UninitializedLeakChecking indicates that the leak checker has not yet been initialized. UninitializedLeakChecking LeakMode = iota @@ -244,6 +246,11 @@ func SetLeakMode(mode LeakMode) { atomic.StoreUint32(&leakMode, uint32(mode)) } +// GetLeakMode returns the current leak mode. +func GetLeakMode() LeakMode { + return LeakMode(atomic.LoadUint32(&leakMode)) +} + const maxStackFrames = 40 type fileLine struct { |