• Austin Clements's avatar
    runtime: introduce higher-level GC work abstraction · b30d19de
    Austin Clements authored
    This introduces a producer/consumer abstraction for GC work pointers
    that internally handles the details of filling, draining, and
    shuffling work buffers.
    
    In addition to simplifying the GC code, this should make it easy for
    us to change how we use work buffers, including cleaning up how we use
    the work.partial queue, reintroducing a FIFO lookahead cache, adding
    prefetching, and using dual buffers to avoid flapping.
    
    This commit doesn't change any existing code.  The following commit
    will switch the garbage collector from explicit workbuf manipulation
    to gcWork.
    
    Change-Id: Ifbfe5fff45bf0362d6d7c3cecb061f0c9874077d
    Reviewed-on: https://go-review.googlesource.com/5231Reviewed-by: default avatarRuss Cox <rsc@golang.org>
    Reviewed-by: default avatarRick Hudson <rlh@golang.org>
    b30d19de
mgc.go 52.5 KB