Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for AllocsPerRun (0.3 sec)

  1. 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)
  2. 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)
  3. src/bufio/bufio_test.go

    	r := strings.NewReader("       foo       foo        42        42        42        42        42        42        42        42       4.2       4.2       4.2       4.2\n")
    	buf := NewReader(r)
    	allocs := testing.AllocsPerRun(100, func() {
    		r.Seek(0, io.SeekStart)
    		buf.Reset(r)
    
    		_, err := buf.ReadString('\n')
    		if err != nil {
    			t.Fatal(err)
    		}
    	})
    	if allocs != 1 {
    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)
  4. 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)
Back to top