On Thu, Apr 11, 2019 at 12:21 PM jianfeng ye <[email protected]>
wrote:
>
> and i want to got the code where go build check slice's cap to decide
where use growslice?
You can find the source easily[x] but I think the more important question
is why you need it. It's an implementation detail of the particular
compiler and version. It may change without notice. Meaning, the
information is not reliable and thus hardly useful if you're thinking about
some kind of optimization tailored to it.
[x]:
$ go version
go version go1.12.1 linux/amd64
$ cd ~/go/src
$ grep -nwr growslice
runtime/slice.go:66:// growslice handles slice growth during append.
runtime/slice.go:76:func growslice(et *_type, old slice, cap int) slice {
...
$
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.