Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: merge growslice and growslice_n #11419

Closed
rsc opened this issue Jun 26, 2015 · 2 comments
Closed

runtime: merge growslice and growslice_n #11419

rsc opened this issue Jun 26, 2015 · 2 comments

Comments

@rsc
Copy link
Contributor

rsc commented Jun 26, 2015

Clean up the fix from #11403. Adjust call sites using growslice_n to use growslice instead. Be careful: must make sure to use unsigned comparisons.

@rsc rsc modified the milestones: Go1.6, Go1.6Early Jun 26, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/11541 mentions this issue.

mk0x9 pushed a commit to mk0x9/go that referenced this issue Jun 26, 2015
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 golang#11403.

Filed golang#11419 to merge them.

Change-Id: I1338b1e5b352f3be4e43641f44b652ef7195251b
Reviewed-on: https://go-review.googlesource.com/11541
Reviewed-by: Austin Clements <austin@google.com>
@rsc rsc modified the milestones: Unplanned, Go1.6Early Nov 4, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/20647 mentions this issue.

@golang golang locked and limited conversation to collaborators Mar 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants