Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. src/bytes/buffer_test.go

    // should not result in any allocations.
    // This can be used to reset the underlying []byte of an existing Buffer.
    func TestNewBufferShallow(t *testing.T) {
    	testenv.SkipIfOptimizationOff(t)
    	n := testing.AllocsPerRun(1000, func() {
    		buf = *NewBuffer(testBytes)
    	})
    	if n > 0 {
    		t.Errorf("allocations occurred while shallow copying")
    	}
    	check(t, "NewBuffer", &buf, testString)
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K 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 30 11:13:12 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 30 11:13:12 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 May 07 11:14:38 GMT 2024
    - Last Modified: Thu Mar 31 20:37:15 GMT 2022
    - 2.6M bytes
    - Viewed (0)
Back to top