cmd/compile, runtime: set alignment of type descriptors
This trivial change reduces the size of cmd/go by 88K.
For #6853
For #36313
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)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |