diff options
| author | Keith Randall <khr@golang.org> | 2014-12-27 20:58:00 -0800 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2014-12-28 06:16:16 +0000 |
| commit | b2a950bb7343a46ff3edd8502fe2f02fc051a308 (patch) | |
| tree | 97511001e7aa590d22b1b0d8c962467319180681 /src/runtime/hashmap.go | |
| parent | ddef2d27fec52c271ee72911e60b07f5f62cf3cb (diff) | |
| download | go-b2a950bb7343a46ff3edd8502fe2f02fc051a308.tar.xz | |
runtime: rename gothrow to throw
Rename "gothrow" to "throw" now that the C version of "throw"
is no longer needed.
This change is purely mechanical except in panic.go where the
old version of "throw" has been deleted.
sed -i "" 's/[[:<:]]gothrow[[:>:]]/throw/g' runtime/*.go
Change-Id: Icf0752299c35958b92870a97111c67bcd9159dc3
Reviewed-on: https://go-review.googlesource.com/2150
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
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 { |
