aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2025-12-04 13:49:21 -0800
committerGopher Robot <gobot@golang.org>2026-02-10 21:27:59 -0800
commita430bc1bd73ab9a7d4a0c740add9760914588396 (patch)
tree592d32b39ac9e812cb50ff4cab2046d080043ab2 /src/runtime
parent67d449c0a608ab6c9891bb9b16cc14016bde8848 (diff)
downloadgo-a430bc1bd73ab9a7d4a0c740add9760914588396.tar.xz
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 Reviewed-on: https://go-review.googlesource.com/c/go/+/727021 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/type.go11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/runtime/type.go b/src/runtime/type.go
index ae8da3bc29..1abd271c3f 100644
--- a/src/runtime/type.go
+++ b/src/runtime/type.go
@@ -535,16 +535,7 @@ func moduleTypelinks(md *moduledata) []*_type {
etypedesc := md.types + md.typedesclen
for td < etypedesc {
- // TODO: The fact that type descriptors are aligned to
- // 0x20 does not make sense.
- if GOARCH == "arm" {
- td = alignUp(td, 0x8)
- } else if GOOS == "aix" {
- // The alignment of 8 is forced in the linker on AIX.
- td = alignUp(td, 0x8)
- } else {
- td = alignUp(td, 0x20)
- }
+ td = alignUp(td, goarch.PtrSize)
typ := (*_type)(unsafe.Pointer(td))
ret = append(ret, typ)