]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: let Pinner preallocate a reusable ref array
authorSven Anderson <sven@anderson.de>
Thu, 18 May 2023 19:45:28 +0000 (21:45 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 23 May 2023 15:33:48 +0000 (15:33 +0000)
commit4bb38fe458cab82711b9a3c96c57a9ea106b044a
tree4f6b0dce7a27e5186d9ecfa26fd54763641aa48c
parent40bdc5618053c16e171473b99186affcbda2166c
runtime: let Pinner preallocate a reusable ref array

With this change a Pinner preallocates an array of 5 pointers for
references to pinned objects. This reduces allocations when a pinner
is reused with up to 5 pinned objects.

This is a follow-up to CL 367296.

Signed-off-by: Sven Anderson <sven@anderson.de>
Change-Id: Ibea0b9ee4d7e39b0341a1da9d8276a4283e4956d
Reviewed-on: https://go-review.googlesource.com/c/go/+/496275
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
src/runtime/pinner.go