Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1823)

Unified Diff: src/pkg/runtime/hashmap_fast.go

Issue 119360043: code review 119360043: runtime: convert hash functions to Go calling convention. (Closed)
Patch Set: diff -r c6b7f7454ffc https://khr%40golang.org@code.google.com/p/go/ Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/runtime/hashmap.go ('k') | src/pkg/runtime/iface.goc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/runtime/hashmap_fast.go
===================================================================
--- a/src/pkg/runtime/hashmap_fast.go
+++ b/src/pkg/runtime/hashmap_fast.go
@@ -23,7 +23,7 @@
// One-bucket table. No need to hash.
b = (*bmap)(h.buckets)
} else {
- hash := gohash(t.key.alg, unsafe.Pointer(&key), 4, uintptr(h.hash0))
+ hash := goalg(t.key.alg).hash(noescape(unsafe.Pointer(&key)), 4, uintptr(h.hash0))
m := uintptr(1)<<h.B - 1
b = (*bmap)(add(h.buckets, (hash&m)*uintptr(h.bucketsize)))
if c := h.oldbuckets; c != nil {
@@ -67,7 +67,7 @@
// One-bucket table. No need to hash.
b = (*bmap)(h.buckets)
} else {
- hash := gohash(t.key.alg, unsafe.Pointer(&key), 4, uintptr(h.hash0))
+ hash := goalg(t.key.alg).hash(noescape(unsafe.Pointer(&key)), 4, uintptr(h.hash0))
m := uintptr(1)<<h.B - 1
b = (*bmap)(add(h.buckets, (hash&m)*uintptr(h.bucketsize)))
if c := h.oldbuckets; c != nil {
@@ -111,7 +111,7 @@
// One-bucket table. No need to hash.
b = (*bmap)(h.buckets)
} else {
- hash := gohash(t.key.alg, unsafe.Pointer(&key), 8, uintptr(h.hash0))
+ hash := goalg(t.key.alg).hash(noescape(unsafe.Pointer(&key)), 8, uintptr(h.hash0))
m := uintptr(1)<<h.B - 1
b = (*bmap)(add(h.buckets, (hash&m)*uintptr(h.bucketsize)))
if c := h.oldbuckets; c != nil {
@@ -155,7 +155,7 @@
// One-bucket table. No need to hash.
b = (*bmap)(h.buckets)
} else {
- hash := gohash(t.key.alg, unsafe.Pointer(&key), 8, uintptr(h.hash0))
+ hash := goalg(t.key.alg).hash(noescape(unsafe.Pointer(&key)), 8, uintptr(h.hash0))
m := uintptr(1)<<h.B - 1
b = (*bmap)(add(h.buckets, (hash&m)*uintptr(h.bucketsize)))
if c := h.oldbuckets; c != nil {
@@ -254,7 +254,7 @@
return unsafe.Pointer(t.elem.zero)
}
dohash:
- hash := gohash(t.key.alg, unsafe.Pointer(&ky), 2*ptrSize, uintptr(h.hash0))
+ hash := goalg(t.key.alg).hash(noescape(unsafe.Pointer(&ky)), 2*ptrSize, uintptr(h.hash0))
m := uintptr(1)<<h.B - 1
b := (*bmap)(add(h.buckets, (hash&m)*uintptr(h.bucketsize)))
if c := h.oldbuckets; c != nil {
@@ -356,7 +356,7 @@
return unsafe.Pointer(t.elem.zero), false
}
dohash:
- hash := gohash(t.key.alg, unsafe.Pointer(&ky), 2*ptrSize, uintptr(h.hash0))
+ hash := goalg(t.key.alg).hash(noescape(unsafe.Pointer(&ky)), 2*ptrSize, uintptr(h.hash0))
m := uintptr(1)<<h.B - 1
b := (*bmap)(add(h.buckets, (hash&m)*uintptr(h.bucketsize)))
if c := h.oldbuckets; c != nil {
« no previous file with comments | « src/pkg/runtime/hashmap.go ('k') | src/pkg/runtime/iface.goc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b