mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
These can be implemented with just a compare and a move instruction.
Do so, avoiding the overhead of a call into the runtime.
These assertions are a significant cost in Go code that uses interface{}
as a safe alternative to C's void* (or unsafe.Pointer), such as the
current version of the Go compiler.
*T here includes pointer to T but also any Go type represented as
a single pointer (chan, func, map). It does not include [1]*T or struct{*int}.
That requires more work in other parts of the compiler; there is a TODO.
Change-Id: I7ff681c20d2c3eb6ad11dd7b3a37b1f3dda23965
Reviewed-on: https://go-review.googlesource.com/7862
Reviewed-by: Rob Pike <r@golang.org>
|
||
|---|---|---|
| .. | ||
| embed1.dir | ||
| private.dir | ||
| recursive1.dir | ||
| assertinline.go | ||
| bigdata.go | ||
| convert.go | ||
| convert1.go | ||
| convert2.go | ||
| embed.go | ||
| embed1.go | ||
| embed2.go | ||
| explicit.go | ||
| fail.go | ||
| fake.go | ||
| noeq.go | ||
| pointer.go | ||
| private.go | ||
| receiver.go | ||
| receiver1.go | ||
| recursive.go | ||
| recursive1.go | ||
| returntype.go | ||
| struct.go | ||