summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/libc/mem_musl.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_musl.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_musl.go')
-rw-r--r--vendor/modernc.org/libc/mem_musl.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/modernc.org/libc/mem_musl.go b/vendor/modernc.org/libc/mem_musl.go
index 1d43cff1e..20f6c18b9 100644
--- a/vendor/modernc.org/libc/mem_musl.go
+++ b/vendor/modernc.org/libc/mem_musl.go
@@ -127,6 +127,25 @@ func UsableSize(p uintptr) Tsize_t {
return Tsize_t(memory.UintptrUsableSize(p))
}
+type MemAllocatorStat struct {
+ Allocs int
+ Bytes int
+ Mmaps int
+}
+
+// MemStat returns the global memory allocator statistics.
+// should be compiled with the memory.counters build tag for the data to be available.
+func MemStat() MemAllocatorStat {
+ allocatorMu.Lock()
+ defer allocatorMu.Unlock()
+
+ return MemAllocatorStat{
+ Allocs: allocator.Allocs,
+ Bytes: allocator.Bytes,
+ Mmaps: allocator.Mmaps,
+ }
+}
+
// MemAuditStart locks the memory allocator, initializes and enables memory
// auditing. Finaly it unlocks the memory allocator.
//