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/stack_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/runtime/stack_test.go') diff --git a/src/runtime/stack_test.go b/src/runtime/stack_test.go index 652c72eeed..17e33327ae 100644 --- a/src/runtime/stack_test.go +++ b/src/runtime/stack_test.go @@ -395,3 +395,21 @@ func TestStackPanic(t *testing.T) { useStack(32) panic("test panic") } + +func BenchmarkStackCopy(b *testing.B) { + c := make(chan bool) + for i := 0; i < b.N; i++ { + go func() { + count(1000000) + c <- true + }() + <-c + } +} + +func count(n int) int { + if n == 0 { + return 0 + } + return 1 + count(n-1) +} -- cgit v1.3