diff options
Diffstat (limited to 'src/runtime/hashmap.go')
| -rw-r--r-- | src/runtime/hashmap.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go index 077a4dfc98..f0759b58a9 100644 --- a/src/runtime/hashmap.go +++ b/src/runtime/hashmap.go @@ -158,7 +158,7 @@ func (b *bmap) setoverflow(t *maptype, ovf *bmap) { func makemap(t *maptype, hint int64) *hmap { if sz := unsafe.Sizeof(hmap{}); sz > 48 || sz != uintptr(t.hmap.size) { - gothrow("bad hmap size") + throw("bad hmap size") } if hint < 0 || int64(int32(hint)) != hint { @@ -167,41 +167,41 @@ func makemap(t *maptype, hint int64) *hmap { } if !ismapkey(t.key) { - gothrow("runtime.makemap: unsupported map key type") + throw("runtime.makemap: unsupported map key type") } // check compiler's and reflect's math if t.key.size > maxKeySize && (!t.indirectkey || t.keysize != uint8(ptrSize)) || t.key.size <= maxKeySize && (t.indirectkey || t.keysize != uint8(t.key.size)) { - gothrow("key size wrong") + throw("key size wrong") } if t.elem.size > maxValueSize && (!t.indirectvalue || t.valuesize != uint8(ptrSize)) || t.elem.size <= maxValueSize && (t.indirectvalue || t.valuesize != uint8(t.elem.size)) { - gothrow("value size wrong") + throw("value size wrong") } // invariants we depend on. We should probably check these at compile time // somewhere, but for now we'll do it here. if t.key.align > bucketCnt { - gothrow("key align too big") + throw("key align too big") } if t.elem.align > bucketCnt { - gothrow("value align too big") + throw("value align too big") } if uintptr(t.key.size)%uintptr(t.key.align) != 0 { - gothrow("key size not a multiple of key align") + throw("key size not a multiple of key align") } if uintptr(t.elem.size)%uintptr(t.elem.align) != 0 { - gothrow("value size not a multiple of value align") + throw("value size not a multiple of value align") } if bucketCnt < 8 { - gothrow("bucketsize too small for proper alignment") + throw("bucketsize too small for proper alignment") } if dataOffset%uintptr(t.key.align) != 0 { - gothrow("need padding in bucket (key)") + throw("need padding in bucket (key)") } if dataOffset%uintptr(t.elem.align) != 0 { - gothrow("need padding in bucket (value)") + throw("need padding in bucket (value)") } // find size parameter which will hold the requested # of elements @@ -561,7 +561,7 @@ func mapiterinit(t *maptype, h *hmap, it *hiter) { } if unsafe.Sizeof(hiter{})/ptrSize != 10 { - gothrow("hash_iter size incorrect") // see ../../cmd/gc/reflect.c + throw("hash_iter size incorrect") // see ../../cmd/gc/reflect.c } it.t = t it.h = h @@ -735,7 +735,7 @@ next: func hashGrow(t *maptype, h *hmap) { if h.oldbuckets != nil { - gothrow("evacuation not done in time") + throw("evacuation not done in time") } oldbuckets := h.buckets if checkgc { @@ -796,7 +796,7 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) { continue } if top < minTopHash { - gothrow("bad map state") + throw("bad map state") } k2 := k if t.indirectkey { |
