From f098a29630c48543df6c476cfa574ab013cfaaa6 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 6 Aug 2014 16:22:52 -0400 Subject: runtime: use better hash for non-empty interface The implementation 'return 0' results in too many collisions. LGTM=khr R=golang-codereviews, adonovan, khr CC=golang-codereviews, iant, khr, r https://golang.org/cl/125720044 --- src/pkg/runtime/runtime.h | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/pkg/runtime/runtime.h') diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index e6354d7e9c..1d1618b0d6 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -651,19 +651,19 @@ enum { }; void runtime·hashinit(void); -uintptr runtime·memhash(void*, uintptr, uintptr); -uintptr runtime·nohash(void*, uintptr, uintptr); -uintptr runtime·strhash(void*, uintptr, uintptr); -uintptr runtime·interhash(void*, uintptr, uintptr); -uintptr runtime·nilinterhash(void*, uintptr, uintptr); -uintptr runtime·f32hash(void*, uintptr, uintptr); -uintptr runtime·f64hash(void*, uintptr, uintptr); -uintptr runtime·c64hash(void*, uintptr, uintptr); -uintptr runtime·c128hash(void*, uintptr, uintptr); -uintptr runtime·aeshash(void*, uintptr, uintptr); -uintptr runtime·aeshash32(void*, uintptr, uintptr); -uintptr runtime·aeshash64(void*, uintptr, uintptr); -uintptr runtime·aeshashstr(void*, uintptr, uintptr); +void runtime·memhash(void*, uintptr, uintptr, uintptr); +void runtime·nohash(void*, uintptr, uintptr, uintptr); +void runtime·strhash(void*, uintptr, uintptr, uintptr); +void runtime·interhash(void*, uintptr, uintptr, uintptr); +void runtime·nilinterhash(void*, uintptr, uintptr, uintptr); +void runtime·f32hash(void*, uintptr, uintptr, uintptr); +void runtime·f64hash(void*, uintptr, uintptr, uintptr); +void runtime·c64hash(void*, uintptr, uintptr, uintptr); +void runtime·c128hash(void*, uintptr, uintptr, uintptr); +void runtime·aeshash(void*, uintptr, uintptr, uintptr); +void runtime·aeshash32(void*, uintptr, uintptr, uintptr); +void runtime·aeshash64(void*, uintptr, uintptr, uintptr); +void runtime·aeshashstr(void*, uintptr, uintptr, uintptr); void runtime·memequal(bool*, uintptr, void*, void*); void runtime·noequal(bool*, uintptr, void*, void*); @@ -876,8 +876,6 @@ void runtime·mallocinit(void); void runtime·chaninit(void); bool runtime·ifaceeq_c(Iface, Iface); bool runtime·efaceeq_c(Eface, Eface); -uintptr runtime·ifacehash(Iface, uintptr); -uintptr runtime·efacehash(Eface, uintptr); void* runtime·malloc(uintptr size); void runtime·runpanic(Panic*); uintptr runtime·getcallersp(void*); -- cgit v1.3