• Austin Clements's avatar
    runtime: make _MSpanDead be the zero state · f4dcc9b2
    Austin Clements authored
    Currently the zero value of an mspan is in the "in use" state. This
    seems like a bad idea in general. But it's going to wreak havoc when
    we make fixalloc zero allocations: even "freed" mspan objects are
    still on the allspans list and still get looked at by the garbage
    collector. Hence, if we leave the mspan states the way they are,
    allocating a span that reuses old memory will temporarily pass that
    span (which is visible to GC!) through the "in use" state, which can
    cause "unswept span" panics.
    
    Fix all of this by making the zero state "dead".
    
    Updates #17503.
    
    Change-Id: I77c7ac06e297af4b9e6258bc091c37abe102acc3
    Reviewed-on: https://go-review.googlesource.com/31367Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    f4dcc9b2
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...