- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for AllocsPerRun (0.3 sec)
-
src/bytes/buffer_test.go
got.Write(b) } if !Equal(got.Bytes(), want) { t.Fatalf("Bytes() = %q, want %q", got, want) } // With a sufficiently sized buffer, there should be no allocations. n := testing.AllocsPerRun(100, func() { got.Reset() for i := 0; i < 1000; i++ { b := got.AvailableBuffer() b = strconv.AppendInt(b, int64(i), 10) got.Write(b) } }) if n > 0 {
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Thu Apr 20 01:07:29 GMT 2023 - 18.1K bytes - Viewed (0) -
src/bytes/bytes_test.go
var dots = "1....2....3....4" type BinOpTest struct { a string b string i int } func TestEqual(t *testing.T) { // Run the tests and check for allocation at the same time. allocs := testing.AllocsPerRun(10, func() { for _, tt := range compareTests { eql := Equal(tt.a, tt.b) if eql != (tt.i == 0) { t.Errorf(`Equal(%q, %q) = %v`, tt.a, tt.b, eql) } } }) if allocs > 0 {
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Wed Jan 24 16:07:25 GMT 2024 - 56.2K bytes - Viewed (0) -
src/bufio/bufio_test.go
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri Feb 10 18:56:01 GMT 2023 - 51.5K bytes - Viewed (0) -
api/go1.1.txt
pkg syscall, type RawSockaddrInet6 struct, Flowinfo uint32 pkg syscall, type RawSockaddrInet6 struct, Port uint16 pkg syscall, type RawSockaddrInet6 struct, Scope_id uint32 pkg testing, func AllocsPerRun(int, func()) float64 pkg testing, func Verbose() bool pkg testing, method (*B) ReportAllocs() pkg testing, method (*B) Skip(...interface{}) pkg testing, method (*B) SkipNow()
Plain Text - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Thu Mar 31 20:37:15 GMT 2022 - 2.6M bytes - Viewed (0)