replace reflect.interfaceHeader with strongly typed runtime functions

This commit is contained in:
Jaden Weiss
2019-09-21 20:29:20 -04:00
committed by Ayke
parent 65beddafe8
commit d17f500c8b
3 changed files with 25 additions and 19 deletions
+10
View File
@@ -12,6 +12,16 @@ type _interface struct {
value unsafe.Pointer
}
//go:inline
func composeInterface(typecode uintptr, value unsafe.Pointer) _interface {
return _interface{typecode, value}
}
//go:inline
func decomposeInterface(i _interface) (uintptr, unsafe.Pointer) {
return i.typecode, i.value
}
// Return true iff both interfaces are equal.
func interfaceEqual(x, y _interface) bool {
if x.typecode != y.typecode {