• Robert Griesemer's avatar
    token/position: implemented Pos · 18ae6334
    Robert Griesemer authored
    A pos value represents a file-set specific, accurate
    source position value. It is 8x smaller in size than
    the corresponding Position value (4 bytes vs 32 bytes).
    
    Using Pos values instead of Position values in AST
    saves approx. 25MBytes of memory when running godoc
    on the current repository.
    
    This CL introduces the Pos, File, and FileSet data
    types; it does not affect existing code. Another
    (pending CL) will make the change to all dependent
    source files.
    
    Missing: tests
    
    R=r
    CC=golang-dev, rsc
    https://golang.org/cl/2936041
    18ae6334
position.go 8.08 KB