mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
replace reflect.interfaceHeader with strongly typed runtime functions
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user