mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: rename mcache fields to match Go style
This change renames a bunch of malloc statistics stored in the mcache that are all named with the "local_" prefix. It also renames largeAlloc to allocLarge to prevent a naming conflict, and next_sample because it would be the last mcache field with the old C naming style. Change-Id: I29695cb83b397a435ede7e9ad5c3c9be72767ea3 Reviewed-on: https://go-review.googlesource.com/c/go/+/246969 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
d677899e90
commit
c863849800
7 changed files with 71 additions and 71 deletions
|
|
@ -346,18 +346,18 @@ func ReadMemStatsSlow() (base, slow MemStats) {
|
|||
continue
|
||||
}
|
||||
// Collect large allocation stats.
|
||||
largeFree += uint64(c.local_largefree)
|
||||
slow.Frees += uint64(c.local_nlargefree)
|
||||
largeFree += uint64(c.largeFree)
|
||||
slow.Frees += uint64(c.largeFreeCount)
|
||||
|
||||
// Collect tiny allocation stats.
|
||||
tinyAllocs += uint64(c.local_tinyallocs)
|
||||
tinyAllocs += uint64(c.tinyAllocCount)
|
||||
|
||||
// Collect per-sizeclass stats.
|
||||
for i := 0; i < _NumSizeClasses; i++ {
|
||||
slow.Frees += uint64(c.local_nsmallfree[i])
|
||||
bySize[i].Frees += uint64(c.local_nsmallfree[i])
|
||||
bySize[i].Mallocs += uint64(c.local_nsmallfree[i])
|
||||
smallFree += uint64(c.local_nsmallfree[i]) * uint64(class_to_size[i])
|
||||
slow.Frees += uint64(c.smallFreeCount[i])
|
||||
bySize[i].Frees += uint64(c.smallFreeCount[i])
|
||||
bySize[i].Mallocs += uint64(c.smallFreeCount[i])
|
||||
smallFree += uint64(c.smallFreeCount[i]) * uint64(class_to_size[i])
|
||||
}
|
||||
}
|
||||
slow.Frees += tinyAllocs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue