• Russ Cox's avatar
    runtime: reduce slice growth during append to 2x · 32fddadd
    Russ Cox authored
    The new inlined code for append assumed that it could pass the
    desired new cap to growslice, not the number of new elements.
    But growslice still interpreted the argument as the number of new elements,
    making it always grow by >2x (more precisely, 2x+1 rounded up
    to the next malloc block size). At the time, I had intended to change
    the other callers to use the new cap as well, but it's too late for that.
    Instead, introduce growslice_n for the old callers and keep growslice
    for the inlined (common case) caller.
    
    Fixes #11403.
    
    Filed #11419 to merge them.
    
    Change-Id: I1338b1e5b352f3be4e43641f44b652ef7195251b
    Reviewed-on: https://go-review.googlesource.com/11541Reviewed-by: 's avatarAustin Clements <austin@google.com>
    32fddadd
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
newlink Loading commit data...
nm Loading commit data...
objdump Loading commit data...
old5a Loading commit data...
old6a Loading commit data...
old8a Loading commit data...
old9a Loading commit data...
pack Loading commit data...
pprof Loading commit data...
trace Loading commit data...
vet Loading commit data...
yacc Loading commit data...