summaryrefslogtreecommitdiff
path: root/src/runtime/mheap.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2021-10-18 23:07:59 +0000
committerMichael Knyszek <mknyszek@google.com>2021-10-20 20:39:25 +0000
commite90492882a7fd580b7dac88675a1c907a7441b40 (patch)
tree237eea6f05b91f1eb106cc7c9a8dc7553325ad95 /src/runtime/mheap.go
parentd419a80bc76cf18d321f9bf37c2deb2b8c0a1415 (diff)
downloadgo-git-e90492882a7fd580b7dac88675a1c907a7441b40.tar.gz
runtime: retype mheap.pagesSwept as atomic.Uint64
[git-generate] cd src/runtime mv export_test.go export.go GOROOT=$(dirname $(dirname $PWD)) rf ' add mheap.pagesSwept pagesSwept_ atomic.Uint64 // pages swept this cycle ex { import "runtime/internal/atomic" var t mheap var v, w uint64 var d int64 t.pagesSwept -> t.pagesSwept_.Load() t.pagesSwept = v -> t.pagesSwept_.Store(v) atomic.Load64(&t.pagesSwept) -> t.pagesSwept_.Load() atomic.LoadAcq64(&t.pagesSwept) -> t.pagesSwept_.LoadAcquire() atomic.Store64(&t.pagesSwept, v) -> t.pagesSwept_.Store(v) atomic.StoreRel64(&t.pagesSwept, v) -> t.pagesSwept_.StoreRelease(v) atomic.Cas64(&t.pagesSwept, v, w) -> t.pagesSwept_.CompareAndSwap(v, w) atomic.Xchg64(&t.pagesSwept, v) -> t.pagesSwept_.Swap(v) atomic.Xadd64(&t.pagesSwept, d) -> t.pagesSwept_.Add(d) } rm mheap.pagesSwept mv mheap.pagesSwept_ mheap.pagesSwept ' mv export.go export_test.go Change-Id: Ife99893d90a339655f604bc3a64ee3decec645ea Reviewed-on: https://go-review.googlesource.com/c/go/+/356709 Trust: Michael Knyszek <mknyszek@google.com> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/mheap.go')
-rw-r--r--src/runtime/mheap.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go
index a787f67460..27f60771eb 100644
--- a/src/runtime/mheap.go
+++ b/src/runtime/mheap.go
@@ -103,7 +103,7 @@ type mheap struct {
// the slope, it would create a discontinuity in debt if any
// progress has already been made.
pagesInUse atomic.Uint64 // pages of spans in stats mSpanInUse
- pagesSwept uint64 // pages swept this cycle; updated atomically
+ pagesSwept atomic.Uint64 // pages swept this cycle
pagesSweptBasis uint64 // pagesSwept to use as the origin of the sweep ratio; updated atomically
sweepHeapLiveBasis uint64 // value of gcController.heapLive to use as the origin of sweep ratio; written with lock, read without
sweepPagesPerByte float64 // proportional sweep ratio; written with lock, read without