• Matthew Dempsky's avatar
    runtime: add mSpanList type to represent lists of mspans · 1652a2c3
    Matthew Dempsky authored
    This CL introduces a new mSpanList type to replace the empty mspan
    variables that were previously used as list heads.
    
    To be type safe, the previous circular linked list data structure is
    now a tail queue instead.  One complication of this is
    mSpanList_Remove needs to know the list a span is being removed from,
    but this appears to be computable in all circumstances.
    
    As a temporary sanity check, mSpanList_Insert and mSpanList_InsertBack
    record the list that an mspan has been inserted into so that
    mSpanList_Remove can verify that the correct list was specified.
    
    Whereas mspan is 112 bytes on amd64, mSpanList is only 16 bytes.  This
    shrinks the size of mheap from 50216 bytes to 12584 bytes.
    
    Change-Id: I8146364753dbc3b4ab120afbb9c7b8740653c216
    Reviewed-on: https://go-review.googlesource.com/15906
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: 's avatarAustin Clements <austin@google.com>
    1652a2c3
mheap.go 33.6 KB