aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mgcsweep.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2025-03-04 19:02:48 +0000
committerGopher Robot <gobot@golang.org>2025-04-23 08:00:33 -0700
commit528bafa0498bb26a3b3961fa5bf50d02bd7101bb (patch)
treeeb72406f4a0ce690d368b2377e2df031457775ca /src/runtime/mgcsweep.go
parentecdd429a3be7abde6e169b79da13bffdba064cb4 (diff)
downloadgo-528bafa0498bb26a3b3961fa5bf50d02bd7101bb.tar.xz
runtime: move sizeclass defs to new package internal/runtime/gc
We will want to reference these definitions from new generator programs, and this is a good opportunity to cleanup all these old C-style names. Change-Id: Ifb06f0afc381e2697e7877f038eca786610c96de Reviewed-on: https://go-review.googlesource.com/c/go/+/655275 Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
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 b6890bac47..4fd80a6883 100644
--- a/src/runtime/mgcsweep.go
+++ b/src/runtime/mgcsweep.go
@@ -517,7 +517,7 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
trace := traceAcquire()
if trace.ok() {
- trace.GCSweepSpan(s.npages * _PageSize)
+ trace.GCSweepSpan(s.npages * pageSize)
traceRelease(trace)
}
@@ -981,9 +981,9 @@ func gcPaceSweeper(trigger uint64) {
// concurrent sweep are less likely to leave pages
// unswept when GC starts.
heapDistance -= 1024 * 1024
- if heapDistance < _PageSize {
+ if heapDistance < pageSize {
// Avoid setting the sweep ratio extremely high
- heapDistance = _PageSize
+ heapDistance = pageSize
}
pagesSwept := mheap_.pagesSwept.Load()
pagesInUse := mheap_.pagesInUse.Load()