mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] all: merge master (f22ec51) into dev.typeparams
Merge List: + 2021-05-25f22ec51debdoc: add Go 1.17 release note about inlining functions with closures + 2021-05-258b462d7567cmd/go: add a -compat flag to 'go mod tidy' + 2021-05-24c89f1224a5net: verify results from Lookup* are valid domain names + 2021-05-2408a8fa9c47misc/wasm: ensure correct stack pointer in catch clauses + 2021-05-2432b73ae180cmd/go: align checks of module path during initialization. + 2021-05-2415d9d4a009cmd/go: add tests illustrating what happens when Go 1.16 is used in a Go 1.17 main module + 2021-05-24873401df5bcmd/compile: ensure equal functions don't do unaligned loads + 2021-05-24b83610699acmd/compile: record regabi status in DW_AT_producer + 2021-05-24a22e317220cmd/compile: always include underlying type for map types + 2021-05-244356e7e85fruntime: account for spill slots in Windows callback compilation + 2021-05-2452d7033ff6cmd/go/internal/modload: set the default GoVersion in a single location + 2021-05-2405819bc104cmd/go/internal/modcmd: factor out a type for flags whose arguments are Go versions + 2021-05-22cca23a7373cmd/compile: revert CL/316890 + 2021-05-21f87194cbd7doc/go1.17: document changes to net/http package + 2021-05-21217f5dd496doc: document additional atomic.Value methods + 2021-05-213c656445f1cmd/go: in TestScript/mod_replace, download an explicit module path + 2021-05-2176b2d6afedos: document that StartProcess puts files into blocking mode + 2021-05-21e4d7525c3ecmd/dist: display first class port status in json output + 2021-05-214fb10b2118cmd/go: in 'go mod download' without args, don't save module zip sums + 2021-05-214fda54ce3fdoc/go1.17: document database/sql changes for Go 1.17 + 2021-05-218876b9bd6adoc/go1.17: document io/fs changes for Go 1.17 + 2021-05-215fee772c87doc/go1.17: document archive/zip changes for Go 1.17 + 2021-05-213148694f60cmd/go: remove warning from module deprecation notice printing + 2021-05-217e63c8b765runtime: wait for Go runtime to initialize in Windows signal test + 2021-05-21831573cd21io/fs: added an example for io/fs.WalkDir + 2021-05-20baa934d26dcmd: go get golang.org/x/tools/analysis@49064d23 && go mod vendor + 2021-05-207c692cc7eadoc/go1.17: document changes to os package + 2021-05-20ce9a3b79d5crypto/x509: add new FreeBSD 12.2+ trusted certificate folder + 2021-05-20f8be906d74test: re-enable test on riscv64 now that it supports external linking + 2021-05-20def5360541doc/go1.17: add release notes for OpenBSD ports + 2021-05-20ef1f52cc38doc/go1.17: add release note for windows/arm64 port + 2021-05-20bb7495a46ddoc/go1.17: document new math constants + 2021-05-20f07e4dae3csyscall: document NewCallback and NewCallbackCDecl limitations + 2021-05-20a8d85918b6misc/cgo/testplugin: skip TestIssue25756pie on darwin/arm64 builder + 2021-05-196c1c055d1ecmd/internal/moddeps: use filepath.SkipDir only on directories + 2021-05-19658b5e66ecnet: return nil UDPAddr from ReadFromUDP + 2021-05-1915a374d5c1test: check portable error message on issue46234.go + 2021-05-18eeadce2d87go/build/constraint: fix parsing of "// +build" (with no args) + 2021-05-186d2ef2ef2acmd/compile: don't emit inltree for closure within body of inlined func + 2021-05-18048cb4ceeecrypto/x509: remove duplicate import Change-Id: Ib0442e3555493805f2aa1df26dfd6898df989a37
This commit is contained in:
commit
5c1e119d48
76 changed files with 2361 additions and 439 deletions
|
|
@ -1146,31 +1146,6 @@ func SemNwait(addr *uint32) uint32 {
|
|||
return atomic.Load(&root.nwait)
|
||||
}
|
||||
|
||||
// MapHashCheck computes the hash of the key k for the map m, twice.
|
||||
// Method 1 uses the built-in hasher for the map.
|
||||
// Method 2 uses the typehash function (the one used by reflect).
|
||||
// Returns the two hash values, which should always be equal.
|
||||
func MapHashCheck(m interface{}, k interface{}) (uintptr, uintptr) {
|
||||
// Unpack m.
|
||||
mt := (*maptype)(unsafe.Pointer(efaceOf(&m)._type))
|
||||
mh := (*hmap)(efaceOf(&m).data)
|
||||
|
||||
// Unpack k.
|
||||
kt := efaceOf(&k)._type
|
||||
var p unsafe.Pointer
|
||||
if isDirectIface(kt) {
|
||||
q := efaceOf(&k).data
|
||||
p = unsafe.Pointer(&q)
|
||||
} else {
|
||||
p = efaceOf(&k).data
|
||||
}
|
||||
|
||||
// Compute the hash functions.
|
||||
x := mt.hasher(noescape(p), uintptr(mh.hash0))
|
||||
y := typehash(kt, noescape(p), uintptr(mh.hash0))
|
||||
return x, y
|
||||
}
|
||||
|
||||
// mspan wrapper for testing.
|
||||
//go:notinheap
|
||||
type MSpan mspan
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue