- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for TypeHash (0.35 sec)
-
src/runtime/alg.go
// typehash, but we want to report the topmost type in // the error text (e.g. in a struct with a field of slice type // we want to report the struct, not the slice). panic(errorString("hash of unhashable type " + toRType(t).string())) } if isDirectIface(t) { return c1 * typehash(t, unsafe.Pointer(&a.data), h^c0) } else { return c1 * typehash(t, a.data, h^c0) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 17:58:53 UTC 2024 - 13.6K bytes - Viewed (0) -
src/runtime/type.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:17:26 UTC 2024 - 12.7K bytes - Viewed (0) -
src/cmd/compile/internal/types/fmt.go
i-- } const dot = "ยท" if i >= len(dot) && name[i-len(dot):i] == dot { i -= len(dot) return name[:i], name[i:] } return name, "" } // TypeHash computes a hash value for type t to use in type switch statements. func TypeHash(t *Type) uint32 { p := t.LinkString() // Using SHA256 is overkill, but reduces accidental collisions. h := notsha256.Sum256([]byte(p))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 12 15:41:17 UTC 2023 - 15.7K bytes - Viewed (0) -
src/cmd/compile/internal/types2/typestring.go
w.string(f.pkg.Path()) w.string(" */ ") } if tag := t.Tag(i); tag != "" { w.byte(' ') // TODO(gri) If tag contains blanks, replacing them with '#' // in Context.TypeHash may produce another tag // accidentally. w.string(strconv.Quote(tag)) } } w.byte('}') case *Pointer: w.byte('*') w.typ(t.base) case *Tuple:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 12.2K bytes - Viewed (0) -
src/go/types/typestring.go
w.string(f.pkg.Path()) w.string(" */ ") } if tag := t.Tag(i); tag != "" { w.byte(' ') // TODO(gri) If tag contains blanks, replacing them with '#' // in Context.TypeHash may produce another tag // accidentally. w.string(strconv.Quote(tag)) } } w.byte('}') case *Pointer: w.byte('*') w.typ(t.base) case *Tuple:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 12.3K bytes - Viewed (0) -
src/cmd/compile/internal/types2/stmt.go
err.report() continue L } } seen[T] = e if x != nil && T != nil { check.typeAssertion(e, x, T, true) } } return } // TODO(gri) Once we are certain that typeHash is correct in all situations, use this version of caseTypes instead. // (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.) //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 30.7K bytes - Viewed (0) -
src/go/types/stmt.go
err.report() continue L } } seen[T] = e if x != nil && T != nil { check.typeAssertion(e, x, T, true) } } return } // TODO(gri) Once we are certain that typeHash is correct in all situations, use this version of caseTypes instead. // (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.) //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 30.6K bytes - Viewed (0) -
src/cmd/compile/internal/walk/switch.go
[]ir.Node{ir.NewTypeAssertExpr(c.pos, s.srcName, c.typ.Type())}) // iface.(type) nif := ir.NewIfStmt(c.pos, s.okName, []ir.Node{c.jmp}, nil) clauses = append(clauses, typeClause{ hash: types.TypeHash(c.typ.Type()), body: []ir.Node{typecheck.Stmt(as), typecheck.Stmt(nif)}, }) } s.flush(clauses, &sw.Compiled) concreteCases = concreteCases[:0] }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:34:01 UTC 2024 - 30.1K bytes - Viewed (0) -
src/runtime/map_test.go
} type canString int func (c canString) String() string { return fmt.Sprintf("%d", int(c)) } func TestMapInterfaceKey(t *testing.T) { // Test all the special cases in runtime.typehash. type GrabBag struct { f32 float32 f64 float64 c64 complex64 c128 complex128 s string i0 any i1 interface { String() string } a [4]string }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 33.5K bytes - Viewed (0) -
src/cmd/compile/internal/ssa/rewrite.go
} } return false } func fixed32(c *Config, sym Sym, off int64) int32 { lsym := sym.(*obj.LSym) if ti, ok := (*lsym.Extra).(*obj.TypeInfo); ok { if off == 2*c.PtrSize { return int32(types.TypeHash(ti.Type.(*types.Type))) } } base.Fatalf("fixed32 data not known for %s:%d", sym, off) return 0 } // isFixedSym returns true if the contents of sym at the given offset
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 07 19:02:52 UTC 2024 - 64.2K bytes - Viewed (0)