aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2022-10-18 16:07:36 -0700
committerKeith Randall <khr@google.com>2022-10-31 21:41:20 +0000
commit68bd383368b5958f8f02c49bc75134a0ef61daec (patch)
tree49c5272deb4f1416918a11644e351c491dd5a647 /src/os/exec/exec.go
parent7ddc45263c739db254a07bb04848e3e5da4982ed (diff)
downloadgo-68bd383368b5958f8f02c49bc75134a0ef61daec.tar.xz
cmd/compile: add cache of sizeable objects so they can be reused
We kind of have this mechanism already, just normalizing it and using it in a bunch of places. Previously a bunch of places cached slices only for the duration of a single function compilation. Now we can reuse slices across a whole compiler run. Use a sync.Pool of powers-of-two sizes. This lets us use not too much memory, and avoid holding onto memory we're no longer using when a GC happens. There's a few different types we need, so generate the code for it. Generics would be useful here, but we can't use generics in the compiler because of bootstrapping. Change-Id: I6cf37e7b7b2e802882aaa723a0b29770511ccd82 Reviewed-on: https://go-review.googlesource.com/c/go/+/444820 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/os/exec/exec.go')
0 files changed, 0 insertions, 0 deletions