From 528bafa0498bb26a3b3961fa5bf50d02bd7101bb Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 4 Mar 2025 19:02:48 +0000 Subject: 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 LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui Reviewed-by: Michael Pratt --- src/runtime/traceallocfree.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/runtime/traceallocfree.go') diff --git a/src/runtime/traceallocfree.go b/src/runtime/traceallocfree.go index 40f1cfe8ab..70e48ea3a6 100644 --- a/src/runtime/traceallocfree.go +++ b/src/runtime/traceallocfree.go @@ -8,6 +8,7 @@ package runtime import ( "internal/abi" + "internal/runtime/gc" "internal/runtime/sys" "internal/trace/tracev2" ) @@ -38,7 +39,7 @@ func traceSnapshotMemory(gen uintptr) { // Emit info. w.varint(uint64(trace.minPageHeapAddr)) w.varint(uint64(pageSize)) - w.varint(uint64(minHeapAlign)) + w.varint(uint64(gc.MinHeapAlign)) w.varint(uint64(fixedStack)) // Finish writing the batch. @@ -129,7 +130,7 @@ func (tl traceLocker) HeapObjectFree(addr uintptr) { // traceHeapObjectID creates a trace ID for a heap object at address addr. func traceHeapObjectID(addr uintptr) traceArg { - return traceArg(uint64(addr)-trace.minPageHeapAddr) / minHeapAlign + return traceArg(uint64(addr)-trace.minPageHeapAddr) / gc.MinHeapAlign } // GoroutineStackExists records that a goroutine stack already exists at address base with the provided size. -- cgit v1.3