• Russ Cox's avatar
    cmd/gc: use 100x less memory for []byte("string") · d227d680
    Russ Cox authored
    []byte("string") was simplifying to
    []byte{0: 0x73, 1: 0x74, 2: 0x72, 3: 0x69, 4: 0x6e, 5: 0x67},
    but that latter form takes up much more memory in the compiler.
    Preserve the string form and recognize it to turn global variables
    initialized this way into linker-initialized data.
    
    Reduces the compiler memory footprint for a large []byte initialized
    this way from approximately 10 kB/B to under 100 B/B.
    
    See also issue 6643.
    
    R=golang-codereviews, r, iant, oleku.konko, dave, gobot, bradfitz
    CC=golang-codereviews
    https://golang.org/cl/15930045
    d227d680
Name
Last commit
Last update
..
5a Loading commit data...
5c Loading commit data...
5g Loading commit data...
5l Loading commit data...
6a Loading commit data...
6c Loading commit data...
6g Loading commit data...
6l Loading commit data...
8a Loading commit data...
8c Loading commit data...
8g Loading commit data...
8l Loading commit data...
addr2line Loading commit data...
api Loading commit data...
cc Loading commit data...
cgo Loading commit data...
dist Loading commit data...
fix Loading commit data...
gc Loading commit data...
go Loading commit data...
gofmt Loading commit data...
ld Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
prof Loading commit data...
yacc Loading commit data...