diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2015-10-21 12:12:25 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2015-10-21 23:08:22 +0000 |
| commit | 84afa1be76f89a602c1aef73603175e644f1dc2f (patch) | |
| tree | 090b42d927619808e5c4bb61461dfc20b5857463 /src/runtime/export_test.go | |
| parent | 03b0065204df9cd141919890b23de6291ab52885 (diff) | |
| download | go-84afa1be76f89a602c1aef73603175e644f1dc2f.tar.xz | |
runtime: make iface/eface handling more type safe
Change compiler-invoked interface functions to directly take
iface/eface parameters instead of fInterface/interface{} to avoid
needing to always convert.
For the handful of functions that legitimately need to take an
interface{} parameter, add efaceOf to type-safely convert *interface{}
to *eface.
Change-Id: I8928761a12fd3c771394f36adf93d3006a9fcf39
Reviewed-on: https://go-review.googlesource.com/16166
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/export_test.go')
| -rw-r--r-- | src/runtime/export_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index 5c1394899a..d94fcb3bae 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -127,7 +127,7 @@ var BigEndian = _BigEndian // For benchmarking. func BenchSetType(n int, x interface{}) { - e := *(*eface)(unsafe.Pointer(&x)) + e := *efaceOf(&x) t := e._type var size uintptr var p unsafe.Pointer |
