summaryrefslogtreecommitdiffhomepage
path: root/pkg/refs
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-08-04 22:51:27 +0000
committergVisor bot <gvisor-bot@google.com>2020-08-04 22:51:27 +0000
commit14ffef4a9d4561fe9871119262ef66a07c10a47e (patch)
tree67d11c250716e45d5ef19a45ba8e1b5b3a4233dd /pkg/refs
parentb3a9b998b3dd838ce5039432fac1292c6c4c3a4b (diff)
parent0500f84b6f2e279ce953faaff20454aca69ae493 (diff)
Merge release-20200622.1-328-g0500f84b6 (automated)
Diffstat (limited to 'pkg/refs')
-rw-r--r--pkg/refs/refcounter.go7
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 {