• Austin Clements's avatar
    runtime: mark tiny blocks at GC start · 85c22bc3
    Austin Clements authored
    The hybrid barrier requires allocate-black, but there's one case where
    we don't currently allocate black: the tiny allocator. If we allocate
    a *new* tiny alloc block during GC, it will be allocated black, but if
    we allocated the current block before GC, it won't be black, and the
    further allocations from it won't mark it, which means we may free a
    reachable tiny block during sweeping.
    
    Fix this by passing over all mcaches at the beginning of mark, while
    the world is still stopped, and greying their tiny blocks.
    
    Updates #17503.
    
    Change-Id: I04d4df7cc2f553f8f7b1e4cb0b52e2946588111a
    Reviewed-on: https://go-review.googlesource.com/31456Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    85c22bc3
mgc.go 64 KB