• Russ Cox's avatar
    cmd/gc, runtime: treat slices and strings like pointers in garbage collection · 613383c7
    Russ Cox authored
    Before, a slice with cap=0 or a string with len=0 might have its
    base pointer pointing beyond the actual slice/string data into
    the next block. The collector had to ignore slices and strings with
    cap=0 in order to avoid misinterpreting the base pointer.
    
    Now, a slice with cap=0 or a string with len=0 still has a base
    pointer pointing into the actual slice/string data, no matter what.
    The collector can now always scan the pointer, which means
    strings and slices are no longer special.
    
    Fixes #8404.
    
    LGTM=khr, josharian
    R=josharian, khr, dvyukov
    CC=golang-codereviews
    https://golang.org/cl/112570044
    613383c7
Name
Last commit
Last update
api Loading commit data...
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...