mirror of
https://github.com/golang/go
synced 2024-11-24 03:30:18 -07:00
runtime: make mcache.local_cachealloc a uintptr
This field used to decrease with sweeps (and potentially go negative). Now it is always zero or positive, so change it to a uintptr so it meshes better with other memory stats. Change-Id: I6a50a956ddc6077eeaf92011c51743cb69540a3c Reviewed-on: https://go-review.googlesource.com/8899 Reviewed-by: Rick Hudson <rlh@golang.org>
This commit is contained in:
parent
a0452a6821
commit
91c80ce6c7
@ -623,7 +623,7 @@ func mallocgc(size uintptr, typ *_type, flags uint32) unsafe.Pointer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.local_cachealloc += intptr(size)
|
c.local_cachealloc += size
|
||||||
} else {
|
} else {
|
||||||
var s *mspan
|
var s *mspan
|
||||||
shouldhelpgc = true
|
shouldhelpgc = true
|
||||||
|
@ -11,8 +11,8 @@ import "unsafe"
|
|||||||
type mcache struct {
|
type mcache struct {
|
||||||
// The following members are accessed on every malloc,
|
// The following members are accessed on every malloc,
|
||||||
// so they are grouped here for better caching.
|
// so they are grouped here for better caching.
|
||||||
next_sample int32 // trigger heap sample after allocating this many bytes
|
next_sample int32 // trigger heap sample after allocating this many bytes
|
||||||
local_cachealloc intptr // bytes allocated from cache since last lock of heap
|
local_cachealloc uintptr // bytes allocated from cache since last lock of heap
|
||||||
// Allocator cache for tiny objects w/o pointers.
|
// Allocator cache for tiny objects w/o pointers.
|
||||||
// See "Tiny allocator" comment in malloc.go.
|
// See "Tiny allocator" comment in malloc.go.
|
||||||
tiny unsafe.Pointer
|
tiny unsafe.Pointer
|
||||||
|
Loading…
Reference in New Issue
Block a user