From 730f6d14253f7c8f44eff8c03beb5984e2f4c6cf Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 29 Oct 2015 17:14:51 +0000 Subject: compiler, runtime: change type hash/equal to Go funcs Change the type descriptor hash and equal functions from C code pointers to Go func values. This permits them to be set to a Go function closure. This is in preparation for the Go 1.5, so that we can use a closure for the hash/equal functions returned by the new reflect.ArrayOf function. Reviewed-on: https://go-review.googlesource.com/16485 From-SVN: r229541 --- libgo/go/reflect/type.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgo/go') diff --git a/libgo/go/reflect/type.go b/libgo/go/reflect/type.go index 7f0c6a8..61b1955 100644 --- a/libgo/go/reflect/type.go +++ b/libgo/go/reflect/type.go @@ -255,8 +255,8 @@ type rtype struct { size uintptr hash uint32 // hash of type; avoids computation in hash tables - hashfn uintptr // hash function code - equalfn uintptr // equality function code + hashfn func(unsafe.Pointer, uintptr) // hash function + equalfn func(unsafe.Pointer, unsafe.Pointer, uintptr) // equality function gc unsafe.Pointer // garbage collection data string *string // string form; unnecessary but undeniably useful -- cgit v1.1