mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
strings: make use of sizeclasses in (*Builder).Grow
Fixes #64833
Change-Id: Ice3f5dfab65f5525bc7a6f57ddeaabda8d64dfa3
GitHub-Last-Rev: 38f1d6c19d
GitHub-Pull-Request: golang/go#64835
Reviewed-on: https://go-review.googlesource.com/c/go/+/552135
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
cf52e70997
commit
968b71bce4
5 changed files with 26 additions and 7 deletions
|
|
@ -15,7 +15,11 @@ import (
|
|||
// Do not copy a non-zero Builder.
|
||||
type Builder struct {
|
||||
addr *Builder // of receiver, to detect copies by value
|
||||
buf []byte
|
||||
|
||||
// External users should never get direct access to this buffer, since
|
||||
// the slice at some point will be converted to a string using unsafe, also
|
||||
// data between len(buf) and cap(buf) might be uninitialized.
|
||||
buf []byte
|
||||
}
|
||||
|
||||
// noescape hides a pointer from escape analysis. It is the identity function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue