]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/export_test.go
[dev.typeparams] all: merge master (f22ec51) into dev.typeparams
[gostls13.git] / src / runtime / export_test.go
index b4de497aca841479fb1b232732ac821e989866d5..fa878c4946e83041e22c7ba18999b63432347b1f 100644 (file)
@@ -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