diff options
Diffstat (limited to 'libgo/go/strconv/itoa_test.go')
-rw-r--r-- | libgo/go/strconv/itoa_test.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/libgo/go/strconv/itoa_test.go b/libgo/go/strconv/itoa_test.go index 63d2fa44e02..e0213ae9afe 100644 --- a/libgo/go/strconv/itoa_test.go +++ b/libgo/go/strconv/itoa_test.go @@ -5,7 +5,6 @@ package strconv_test import ( - "runtime" . "strconv" "testing" ) @@ -126,39 +125,6 @@ func TestUitoa(t *testing.T) { } } -func numAllocations(f func()) int { - runtime.GC() - memstats := new(runtime.MemStats) - runtime.ReadMemStats(memstats) - n0 := memstats.Mallocs - f() - runtime.ReadMemStats(memstats) - return int(memstats.Mallocs - n0) -} - -/* This test relies on escape analysis which gccgo does not yet do. - -var globalBuf [64]byte - -func TestAppendUintDoesntAllocate(t *testing.T) { - n := numAllocations(func() { - var buf [64]byte - AppendInt(buf[:0], 123, 10) - }) - want := 1 // TODO(bradfitz): this might be 0, once escape analysis is better - if n != want { - t.Errorf("with local buffer, did %d allocations, want %d", n, want) - } - n = numAllocations(func() { - AppendInt(globalBuf[:0], 123, 10) - }) - if n != 0 { - t.Errorf("with reused buffer, did %d allocations, want 0", n) - } -} - -*/ - func BenchmarkFormatInt(b *testing.B) { for i := 0; i < b.N; i++ { for _, test := range itob64tests { |