]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove alignment padding in mheap and pageAlloc
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 7 Sep 2022 20:11:00 +0000 (20:11 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 8 Sep 2022 16:06:00 +0000 (16:06 +0000)
All subfields use atomic types to ensure alignment, so there's no more
need for these fields.

Change-Id: Iada4253f352a074073ce603f1f6b07cbd5b7c58a
Reviewed-on: https://go-review.googlesource.com/c/go/+/429220
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/mheap.go
src/runtime/mpagealloc.go

index be53f7bd91ec5fd60795997f2cb9615b7f04d684..610011863baf255ba526f8eb3cda0a98fc71ddab 100644 (file)
@@ -65,8 +65,6 @@ type mheap struct {
        // could self-deadlock if its stack grows with the lock held.
        lock mutex
 
-       _ uint32 // 8-byte align pages so its alignment is consistent with tests.
-
        pages pageAlloc // page allocation data structure
 
        sweepgen uint32 // sweep generation, see comment in mspan; written during STW
@@ -84,8 +82,6 @@ type mheap struct {
        // access (since that may free the backing store).
        allspans []*mspan // all spans out there
 
-       // _ uint32 // align uint64 fields on 32-bit for atomics
-
        // Proportional sweep
        //
        // These parameters represent a linear function from gcController.heapLive
@@ -191,8 +187,6 @@ type mheap struct {
                base, end uintptr
        }
 
-       _ uint32 // ensure 64-bit alignment of central
-
        // central free lists for small size classes.
        // the padding makes sure that the mcentrals are
        // spaced CacheLinePadSize bytes apart, so that each mcentral.lock
index 83df7c5150e5901f39290a4279223df60b670a1c..853d7fc9ca556217c48538735209b14841035d4a 100644 (file)
@@ -267,8 +267,6 @@ type pageAlloc struct {
        // All access is protected by the mheapLock.
        inUse addrRanges
 
-       _ uint32 // Align scav so it's easier to reason about alignment within scav.
-
        // scav stores the scavenger state.
        scav struct {
                // index is an efficient index of chunks that have pages available to