]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: don't use static init to initialize small structs, fields
authorRuss Cox <rsc@golang.org>
Fri, 17 Oct 2014 17:10:42 +0000 (13:10 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 17 Oct 2014 17:10:42 +0000 (13:10 -0400)
commitcfafa9f4cb1a20c4a9490d5bd8e561e650562f54
treed140ac40423da5babe28864f6b56f895b713fd7a
parent0d81b72e1bf5518b503dbefd0764bfa7e47dcecf
cmd/gc: don't use static init to initialize small structs, fields

Better to avoid the memory loads and just use immediate constants.
This especially applies to zeroing, which was being done by
copying zeros from elsewhere in the binary, even if the value
was going to be completely initialized with non-zero values.
The zero writes were optimized away but the zero loads from
the data segment were not.

LGTM=r
R=r, bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/152700045
src/cmd/gc/sinit.c