summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/libc/mem_expvar.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-04-01 15:24:11 +0000
committerLibravatar GitHub <noreply@github.com>2025-04-01 16:24:11 +0100
commitfdf23a91de791b813f65c244fd75e3262171f1b0 (patch)
tree6ad5045e17f4520386067e4334e749be09ae1510 /vendor/modernc.org/libc/mem_expvar.go
parentadd a security.md stub, until (if) we determine a fancier security process :w... (diff)
downloadgotosocial-fdf23a91de791b813f65c244fd75e3262171f1b0.tar.xz
update modernc.org/sqlite to v1.37.0-concurrrency-workaround (#3958)
Diffstat (limited to 'vendor/modernc.org/libc/mem_expvar.go')
-rw-r--r--vendor/modernc.org/libc/mem_expvar.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/modernc.org/libc/mem_expvar.go b/vendor/modernc.org/libc/mem_expvar.go
new file mode 100644
index 000000000..e2c5aae7a
--- /dev/null
+++ b/vendor/modernc.org/libc/mem_expvar.go
@@ -0,0 +1,12 @@
+//go:build libc.memexpvar
+
+package libc
+
+import "expvar"
+
+func init() {
+ // make sure to build with -tags=memory.counters to have the actual data accumulated in memory allocator
+ expvar.Publish("memory.allocator", expvar.Func(func() interface{} {
+ return MemStat()
+ }))
+}