• Russ Cox's avatar
    cmd/gc: don't use static init to initialize small structs, fields · cfafa9f4
    Russ Cox authored
    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
    cfafa9f4
sinit.c 28.9 KB