runtime: remove trailing empty arrays in structs

The ones at the end of M and G are just used to compute
their size for use in assembly.  Generate the size explicitly.
The one at the end of itab is variable-sized, and at least one.
The ones at the end of interfacetype and uncommontype are not
needed, as the preceding slice references them (the slice was
originally added for use by reflect?).
The one at the end of stackmap is already accessed correctly,
and the runtime never allocates one.

Update #9401

Change-Id: Ia75e3aaee38425f038c506868a17105bd64c712f
Reviewed-on: https://go-review.googlesource.com/2420
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Keith Randall 2015-01-06 20:38:44 -08:00
parent ce5cb037d1
commit 1dd0163ce3
7 changed files with 18 additions and 22 deletions

View file

@ -215,7 +215,6 @@ type g struct {
gopc uintptr // pc of go statement that created this goroutine
racectx uintptr
waiting *sudog // sudog structures this g is waiting on (that have a valid elem ptr)
end [0]byte
}
type mts struct {
@ -298,7 +297,6 @@ type m struct {
notesig *int8
errstr *byte
//#endif
end [0]byte
}
type p struct {
@ -425,7 +423,7 @@ type itab struct {
link *itab
bad int32
unused int32
fun [0]uintptr
fun [1]uintptr // variable sized
}
// Lock-free stack node.