• Robert Griesemer's avatar
    go/parser: fix memory leak by making a copy of token literals · 39a1465d
    Robert Griesemer authored
    The scanner returns slices into the original source
    for token values. If those slices are making it into
    the AST and from there into other long-living data
    structures (e.g. godoc search), references to the
    original source are kept around involuntarily.
    
    For the current godoc and source tree, this change reduces
    memory consumption after indexing and before GC by ~92MB
    or almost 30%, and by ~10MB after GC (or about 6%).
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/4273072
    39a1465d
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...