[go] cmd/compile, runtime: set alignment of type descriptors

6 views
Skip to first unread message

Ian Lance Taylor (Gerrit)

unread,
Dec 4, 2025, 4:52:10 PM12/4/25
to goph...@pubsubhelper.golang.org, Ian Lance Taylor, golang-co...@googlegroups.com

Ian Lance Taylor has uploaded the change for review

Commit message

cmd/compile, runtime: set alignment of type descriptors

This trivial change reduces the size of cmd/go by 88K.

For #6853
For #36313
Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505

Change diff

diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go
index c3f041e..ea3d0b5 100644
--- a/src/cmd/compile/internal/reflectdata/reflect.go
+++ b/src/cmd/compile/internal/reflectdata/reflect.go
@@ -963,6 +963,7 @@
keep = false
}
lsym.Set(obj.AttrMakeTypelink, keep)
+ lsym.Align = int16(types.PtrSize)

return lsym
}
diff --git a/src/runtime/type.go b/src/runtime/type.go
index 215ffa9..4464c86 100644
--- a/src/runtime/type.go
+++ b/src/runtime/type.go
@@ -523,9 +523,7 @@
td++

for td < md.etypedesc {
- // TODO: The fact that type descriptors are aligned to
- // 0x20 does not make sense.
- td = alignUp(td, 0x20)
+ td = alignUp(td, goarch.PtrSize)

typ := (*_type)(unsafe.Pointer(td))
ret = append(ret, typ)

Change information

Files:
  • M src/cmd/compile/internal/reflectdata/reflect.go
  • M src/runtime/type.go
Change size: XS
Delta: 2 files changed, 2 insertions(+), 3 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505
Gerrit-Change-Number: 727021
Gerrit-PatchSet: 1
Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
unsatisfied_requirement
satisfied_requirement
open
diffy

Ian Lance Taylor (Gerrit)

unread,
Dec 4, 2025, 4:52:48 PM12/4/25
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Ian Lance Taylor voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505
Gerrit-Change-Number: 727021
Gerrit-PatchSet: 1
Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Comment-Date: Thu, 04 Dec 2025 21:52:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Keith Randall (Gerrit)

unread,
Dec 5, 2025, 6:54:47 PM12/5/25
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Keith Randall, Go LUCI, Robert Griesemer, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Ian Lance Taylor, Martin Möhrmann and Robert Griesemer

Keith Randall voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Lance Taylor
  • Martin Möhrmann
  • Robert Griesemer
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505
Gerrit-Change-Number: 727021
Gerrit-PatchSet: 1
Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Robert Griesemer <g...@golang.org>
Gerrit-Comment-Date: Fri, 05 Dec 2025 23:54:43 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Keith Randall (Gerrit)

unread,
Dec 5, 2025, 6:54:53 PM12/5/25
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Keith Randall, Go LUCI, Robert Griesemer, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Ian Lance Taylor, Martin Möhrmann and Robert Griesemer

Keith Randall voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Lance Taylor
  • Martin Möhrmann
  • Robert Griesemer
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505
Gerrit-Change-Number: 727021
Gerrit-PatchSet: 1
Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@google.com>
Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Robert Griesemer <g...@golang.org>
Gerrit-Comment-Date: Fri, 05 Dec 2025 23:54:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Carlos Amedee (Gerrit)

unread,
Jan 23, 2026, 11:39:27 AMJan 23
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Go LUCI, Keith Randall, Keith Randall, Robert Griesemer, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Ian Lance Taylor, Martin Möhrmann and Robert Griesemer

Carlos Amedee voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Lance Taylor
  • Martin Möhrmann
  • Robert Griesemer
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505
    Gerrit-Change-Number: 727021
    Gerrit-PatchSet: 8
    Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Keith Randall <k...@golang.org>
    Gerrit-Reviewer: Keith Randall <k...@google.com>
    Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
    Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
    Gerrit-Attention: Robert Griesemer <g...@golang.org>
    Gerrit-Comment-Date: Fri, 23 Jan 2026 16:39:23 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Ian Lance Taylor (Gerrit)

    unread,
    Jan 27, 2026, 1:18:53 PM (11 days ago) Jan 27
    to Ian Lance Taylor, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Ian Lance Taylor, Martin Möhrmann and Robert Griesemer

    Ian Lance Taylor uploaded new patchset

    Ian Lance Taylor uploaded patch set #9 to this change.
    Following approvals got outdated and were removed:
    • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ian Lance Taylor
    • Martin Möhrmann
    • Robert Griesemer
    Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505
      Gerrit-Change-Number: 727021
      Gerrit-PatchSet: 9
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ian Lance Taylor (Gerrit)

      unread,
      Feb 6, 2026, 8:01:41 PM (6 hours ago) Feb 6
      to Ian Lance Taylor, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Ian Lance Taylor, Martin Möhrmann and Robert Griesemer

      Ian Lance Taylor uploaded new patchset

      Ian Lance Taylor uploaded patch set #10 to this change.
      Following approvals got outdated and were removed:
      • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ian Lance Taylor
      • Martin Möhrmann
      • Robert Griesemer
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505
      Gerrit-Change-Number: 727021
      Gerrit-PatchSet: 10
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ian Lance Taylor (Gerrit)

      unread,
      Feb 6, 2026, 8:08:10 PM (6 hours ago) Feb 6
      to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Go LUCI, Carlos Amedee, Keith Randall, Keith Randall, Robert Griesemer, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Martin Möhrmann and Robert Griesemer

      Ian Lance Taylor voted Commit-Queue+1

      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Martin Möhrmann
      • Robert Griesemer
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I5e74acf118bd1c63cbdd256879d8aa8d72a50505
      Gerrit-Change-Number: 727021
      Gerrit-PatchSet: 10
      Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Keith Randall <k...@google.com>
      Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Comment-Date: Sat, 07 Feb 2026 01:08:07 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages