• 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
..
cmd Loading commit data...
lib9 Loading commit data...
libbio Loading commit data...
liblink Loading commit data...
libmach Loading commit data...
pkg Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...
sudo.bash Loading commit data...