aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime.c
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-08-05 11:14:35 -0700
committerRob Pike <r@golang.org>2008-08-05 11:14:35 -0700
commit5adbacb8e7856cd56617e788c112e012303bcb82 (patch)
tree788e4c78b2e69c2ed0d1ce1c8fadf0ad802473e1 /src/runtime/runtime.c
parent033682deec8cf13b4e821e30ef774f843ab1e0d0 (diff)
downloadgo-5adbacb8e7856cd56617e788c112e012303bcb82.tar.xz
allow pointers as keys in maps, treating them the same as ints - ptr eq not value equality
R=ken,gri OCL=13879 CL=13879
Diffstat (limited to 'src/runtime/runtime.c')
-rw-r--r--src/runtime/runtime.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c
index 75d23d50d8..ec2951b0af 100644
--- a/src/runtime/runtime.c
+++ b/src/runtime/runtime.c
@@ -777,7 +777,8 @@ pointercopy(uint32 s, void **a, void **b)
Alg
algarray[3] =
{
- { &memhash, &memequal, &memprint, &memcopy },
- { &stringhash, &stringequal, &stringprint, &stringcopy },
- { &pointerhash, &pointerequal, &pointerprint, &pointercopy },
+ { &memhash, &memequal, &memprint, &memcopy }, // 0
+ { &stringhash, &stringequal, &stringprint, &stringcopy }, // 1
+// { &pointerhash, &pointerequal, &pointerprint, &pointercopy }, // 2
+ { &memhash, &memequal, &memprint, &memcopy }, // 2 - treat pointers as ints
};