aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mgcsweep.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2022-07-13 15:35:44 +0000
committerMichael Anthony Knyszek <mknyszek@google.com>2022-07-13 15:35:44 +0000
commit7d5078e3bf2d865526e8ec2d211f61b2fac2936f (patch)
tree8f434be7d8e2ec1e3e5783f57deacdec41d454d9 /src/runtime/mgcsweep.go
parent4658e6e324a85b0076f66acdab77799ffa9ac7bb (diff)
parent1ed3c127daceaffb9aadc806ba60f0b51b47421b (diff)
downloadgo-7d5078e3bf2d865526e8ec2d211f61b2fac2936f.tar.gz
go-7d5078e3bf2d865526e8ec2d211f61b2fac2936f.zip
[dev.boringcrypto.go1.17] all: merge go1.17.12 into dev.boringcrypto.go1.17
Change-Id: I652dbbb5721fa0c7be09be34b9ac1a987c331f6d
Diffstat (limited to 'src/runtime/mgcsweep.go')
-rw-r--r--src/runtime/mgcsweep.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/mgcsweep.go b/src/runtime/mgcsweep.go
index 8fe3a65340..468df4d097 100644
--- a/src/runtime/mgcsweep.go
+++ b/src/runtime/mgcsweep.go
@@ -581,7 +581,7 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
// free slots zeroed.
s.needzero = 1
stats := memstats.heapStats.acquire()
- atomic.Xadduintptr(&stats.smallFreeCount[spc.sizeclass()], uintptr(nfreed))
+ atomic.Xadd64(&stats.smallFreeCount[spc.sizeclass()], int64(nfreed))
memstats.heapStats.release()
}
if !preserve {
@@ -628,8 +628,8 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
mheap_.freeSpan(s)
}
stats := memstats.heapStats.acquire()
- atomic.Xadduintptr(&stats.largeFreeCount, 1)
- atomic.Xadduintptr(&stats.largeFree, size)
+ atomic.Xadd64(&stats.largeFreeCount, 1)
+ atomic.Xadd64(&stats.largeFree, int64(size))
memstats.heapStats.release()
return true
}