• Dmitriy Vyukov's avatar
    runtime: pass correct size to malloc · 7bcbdbd9
    Dmitriy Vyukov authored
    In both cases we lie to malloc about the actual size that we need.
    In panic we ask for less memory than we are going to use.
    In slice we ask for more memory than we are going to use
    (potentially asking for a fractional number of elements).
    This breaks the new GC.
    
    LGTM=khr
    R=golang-codereviews, dave, khr
    CC=golang-codereviews, rsc
    https://golang.org/cl/116940043
    7bcbdbd9
panic.c 14.9 KB