Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for AllocsPerRun (0.32 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)
Back to top