From b2a950bb7343a46ff3edd8502fe2f02fc051a308 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Sat, 27 Dec 2014 20:58:00 -0800 Subject: 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 Reviewed-by: Dave Cheney --- src/runtime/malloc1.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/runtime/malloc1.go') diff --git a/src/runtime/malloc1.go b/src/runtime/malloc1.go index 3866f77873..50e272c1c1 100644 --- a/src/runtime/malloc1.go +++ b/src/runtime/malloc1.go @@ -89,7 +89,7 @@ func mallocinit() { initSizes() if class_to_size[_TinySizeClass] != _TinySize { - gothrow("bad TinySizeClass") + throw("bad TinySizeClass") } var p, bitmapSize, spansSize, pSize, limit uintptr @@ -196,7 +196,7 @@ func mallocinit() { } } if p == 0 { - gothrow("runtime: cannot reserve arena virtual address space") + throw("runtime: cannot reserve arena virtual address space") } } @@ -214,7 +214,7 @@ func mallocinit() { if mheap_.arena_start&(_PageSize-1) != 0 { println("bad pagesize", hex(p), hex(p1), hex(spansSize), hex(bitmapSize), hex(_PageSize), "start", hex(mheap_.arena_start)) - gothrow("misrounded allocation in mallocinit") + throw("misrounded allocation in mallocinit") } // Initialize the rest of the allocator. @@ -262,7 +262,7 @@ func mHeap_SysAlloc(h *mheap, n uintptr) unsafe.Pointer { } if uintptr(p)&(_PageSize-1) != 0 { - gothrow("misrounded allocation in MHeap_SysAlloc") + throw("misrounded allocation in MHeap_SysAlloc") } return (unsafe.Pointer)(p) } @@ -302,7 +302,7 @@ func mHeap_SysAlloc(h *mheap, n uintptr) unsafe.Pointer { } if uintptr(p)&(_PageSize-1) != 0 { - gothrow("misrounded allocation in MHeap_SysAlloc") + throw("misrounded allocation in MHeap_SysAlloc") } return (unsafe.Pointer)(p) } @@ -313,7 +313,7 @@ func largeAlloc(size uintptr, flag uint32) *mspan { // print("largeAlloc size=", size, "\n") if size+_PageSize < size { - gothrow("out of memory") + throw("out of memory") } npages := size >> _PageShift if size&_PageMask != 0 { @@ -321,7 +321,7 @@ func largeAlloc(size uintptr, flag uint32) *mspan { } s := mHeap_Alloc(&mheap_, npages, 0, true, flag&_FlagNoZero == 0) if s == nil { - gothrow("out of memory") + throw("out of memory") } s.limit = uintptr(s.start)<<_PageShift + size v := unsafe.Pointer(uintptr(s.start) << _PageShift) -- cgit v1.3-5-g9baa