• Keith Randall's avatar
    runtime: shrink bigger stacks without any copying. · f4359afa
    Keith Randall authored
    Instead, split the underlying storage in half and
    free just half of it.
    
    Shrinking without copying lets us reclaim storage used
    by a previously profligate Go routine that has now blocked
    inside some C code.
    
    To shrink in place, we need all stacks to be a power of 2 in size.
    
    LGTM=rsc
    R=golang-codereviews, rsc
    CC=golang-codereviews
    https://golang.org/cl/69580044
    f4359afa
malloc.h 20.9 KB