LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package runtime | 5 package runtime |
6 #include "runtime.h" | 6 #include "runtime.h" |
7 #include "arch_GOARCH.h" | 7 #include "arch_GOARCH.h" |
8 #include "malloc.h" | 8 #include "malloc.h" |
9 #include "type.h" | 9 #include "type.h" |
10 #include "race.h" | 10 #include "race.h" |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 t->key->alg->print(t->key->size, key); | 983 t->key->alg->print(t->key->size, key); |
984 runtime·prints("; val="); | 984 runtime·prints("; val="); |
985 t->elem->alg->print(t->elem->size, val); | 985 t->elem->alg->print(t->elem->size, val); |
986 runtime·prints("\n"); | 986 runtime·prints("\n"); |
987 } | 987 } |
988 } | 988 } |
989 | 989 |
990 #pragma textflag NOSPLIT | 990 #pragma textflag NOSPLIT |
991 func reflect·mapdelete(t *MapType, h *Hmap, key *byte) { | 991 func reflect·mapdelete(t *MapType, h *Hmap, key *byte) { |
992 if(h == nil) | 992 if(h == nil) |
993 » » runtime·panicstring("delete from nil map"); | 993 » » return; // see bug 8051 |
994 if(raceenabled) { | 994 if(raceenabled) { |
995 runtime·racewritepc(h, runtime·getcallerpc(&t), reflect·mapdelet
e); | 995 runtime·racewritepc(h, runtime·getcallerpc(&t), reflect·mapdelet
e); |
996 runtime·racereadobjectpc(key, t->key, runtime·getcallerpc(&t), r
eflect·mapdelete); | 996 runtime·racereadobjectpc(key, t->key, runtime·getcallerpc(&t), r
eflect·mapdelete); |
997 } | 997 } |
998 hash_remove(t, h, key); | 998 hash_remove(t, h, key); |
999 | 999 |
1000 if(debug) { | 1000 if(debug) { |
1001 runtime·prints("mapdelete: map="); | 1001 runtime·prints("mapdelete: map="); |
1002 runtime·printpointer(h); | 1002 runtime·printpointer(h); |
1003 runtime·prints("; key="); | 1003 runtime·prints("; key="); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 len = 0; | 1069 len = 0; |
1070 else { | 1070 else { |
1071 len = h->count; | 1071 len = h->count; |
1072 if(raceenabled) | 1072 if(raceenabled) |
1073 runtime·racereadpc(h, runtime·getcallerpc(&h), reflect·m
aplen); | 1073 runtime·racereadpc(h, runtime·getcallerpc(&h), reflect·m
aplen); |
1074 } | 1074 } |
1075 } | 1075 } |
1076 | 1076 |
1077 // exported value for testing | 1077 // exported value for testing |
1078 float64 runtime·hashLoad = LOAD; | 1078 float64 runtime·hashLoad = LOAD; |
LEFT | RIGHT |