diff options
| author | Michael Pratt <mpratt@google.com> | 2024-09-12 10:44:38 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-10-30 14:07:22 +0000 |
| commit | 3b424cfa9d2704a283bdba544497daad0d47fb65 (patch) | |
| tree | f76053ce29f77f5f0e62ba2c73be4e197c5e9388 /src/runtime/alg.go | |
| parent | 89d7f031720c999e8226cd9624cc2c531f8477e3 (diff) | |
| download | go-3b424cfa9d2704a283bdba544497daad0d47fb65.tar.xz | |
internal/runtime/maps: proper capacity hint handling
When given a hint size, set the initial capacity large enough to avoid
requiring growth in the average case.
When not given a hint (or given 0), don't allocate anything at all.
For #54766.
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-swissmap
Change-Id: I8844fc652b8d2d4e5136cd56f7e78999a07fe381
Reviewed-on: https://go-review.googlesource.com/c/go/+/616457
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/alg.go')
| -rw-r--r-- | src/runtime/alg.go | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/runtime/alg.go b/src/runtime/alg.go index 14ac7e8df3..07c115f74d 100644 --- a/src/runtime/alg.go +++ b/src/runtime/alg.go @@ -256,11 +256,6 @@ func mapKeyError(t *maptype, p unsafe.Pointer) error { return mapKeyError2(t.Key, p) } -//go:linkname maps_mapKeyError internal/runtime/maps.mapKeyError -func maps_mapKeyError(t *maptype, p unsafe.Pointer) error { - return mapKeyError(t, p) -} - func mapKeyError2(t *_type, p unsafe.Pointer) error { if t.TFlag&abi.TFlagRegularMemory != 0 { return nil |
