It isn't specific to maps, so put it in a more general location.
For #54766.
Change-Id: Ia3f3ebe8c347cfa5a8582082a306f4df4e05818d
Reviewed-on: https://go-review.googlesource.com/c/go/+/580777
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
MapMaxKeyBytes = 128
MapMaxElemBytes = 128 // Must fit in a uint8.
)
-
-// ZeroValSize is the size in bytes of runtime.zeroVal.
-const ZeroValSize = 1024
--- /dev/null
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package abi
+
+// ZeroValSize is the size in bytes of runtime.zeroVal.
+const ZeroValSize = 1024
return h.count
}
-var zeroVal [abi.ZeroValSize]byte
-
// mapinitnoop is a no-op function known the Go linker; if a given global
// map (of the right size) is determined to be dead, the linker will
// rewrite the relocation (from the package init func) from the outlined
package runtime
import (
+ "internal/abi"
"internal/runtime/atomic"
"unsafe"
)
var auxv []uintptr
func getAuxv() []uintptr { return auxv } // accessed from x/sys/cpu; see issue 57336
+
+var zeroVal [abi.ZeroValSize]byte