• Austin Clements's avatar
    runtime: make mSpanList more go:notinheap-friendly · 991a85c8
    Austin Clements authored
    Currently mspan links to its previous mspan using a **mspan field that
    points to the previous span's next field. This simplifies some of the
    list manipulation code, but is going to make it very hard to convince
    the compiler that mspan list manipulations don't need write barriers.
    
    Fix this by using a more traditional ("boring") linked list that uses
    a simple *mspan pointer to the previous mspan. This complicates some
    of the list manipulation slightly, but it will let us eliminate all
    write barriers from the mspan list manipulation code by marking mspan
    go:notinheap.
    
    Change-Id: I0d0b212db5f20002435d2a0ed2efc8aa0364b905
    Reviewed-on: https://go-review.googlesource.com/30940Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    991a85c8
mheap.go 40.1 KB