all: clean unnecessary casts for test files

This is a follow up of CL 528696.

Change-Id: I5b71eabedb12567c4b1b36f7182a3d2b0ed662a5
GitHub-Last-Rev: acaf3ac11c
GitHub-Pull-Request: golang/go#62713
Reviewed-on: https://go-review.googlesource.com/c/go/+/529197
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Jes Cok 2023-09-19 10:36:19 +00:00 committed by Gopher Robot
parent bf5d8c02ba
commit 9b883484a8
11 changed files with 31 additions and 31 deletions

View file

@ -73,7 +73,7 @@ func LFStackPush(head *uint64, node *LFNode) {
}
func LFStackPop(head *uint64) *LFNode {
return (*LFNode)(unsafe.Pointer((*lfstack)(head).pop()))
return (*LFNode)((*lfstack)(head).pop())
}
func LFNodeValidate(node *LFNode) {
lfnodeValidate((*lfnode)(unsafe.Pointer(node)))
@ -371,7 +371,7 @@ var ReadUnaligned64 = readUnaligned64
func CountPagesInUse() (pagesInUse, counted uintptr) {
stopTheWorld(stwForTestCountPagesInUse)
pagesInUse = uintptr(mheap_.pagesInUse.Load())
pagesInUse = mheap_.pagesInUse.Load()
for _, s := range mheap_.allspans {
if s.state.get() == mSpanInUse {
@ -404,7 +404,7 @@ const (
)
func (p *ProfBuf) Read(mode profBufReadMode) ([]uint64, []unsafe.Pointer, bool) {
return (*profBuf)(p).read(profBufReadMode(mode))
return (*profBuf)(p).read(mode)
}
func (p *ProfBuf) Close() {
@ -486,15 +486,15 @@ func ReadMemStatsSlow() (base, slow MemStats) {
// Collect per-sizeclass free stats.
var smallFree uint64
for i := 0; i < _NumSizeClasses; i++ {
slow.Frees += uint64(m.smallFreeCount[i])
bySize[i].Frees += uint64(m.smallFreeCount[i])
bySize[i].Mallocs += uint64(m.smallFreeCount[i])
smallFree += uint64(m.smallFreeCount[i]) * uint64(class_to_size[i])
slow.Frees += m.smallFreeCount[i]
bySize[i].Frees += m.smallFreeCount[i]
bySize[i].Mallocs += m.smallFreeCount[i]
smallFree += m.smallFreeCount[i] * uint64(class_to_size[i])
}
slow.Frees += uint64(m.tinyAllocCount) + uint64(m.largeFreeCount)
slow.Frees += m.tinyAllocCount + m.largeFreeCount
slow.Mallocs += slow.Frees
slow.TotalAlloc = slow.Alloc + uint64(m.largeFree) + smallFree
slow.TotalAlloc = slow.Alloc + m.largeFree + smallFree
for i := range slow.BySize {
slow.BySize[i].Mallocs = bySize[i].Mallocs