Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestMapRangeNoAllocations (0.18 sec)

  1. src/sync/map_test.go

    	m := &sync.Map{}
    	if m.CompareAndSwap(m, nil, 42) {
    		// See https://go.dev/issue/51972#issuecomment-1126408637.
    		t.Fatalf("CompareAndSwap on a non-existing key succeeded")
    	}
    }
    
    func TestMapRangeNoAllocations(t *testing.T) { // Issue 62404
    	testenv.SkipIfOptimizationOff(t)
    	var m sync.Map
    	allocs := testing.AllocsPerRun(10, func() {
    		m.Range(func(key, value any) bool {
    			return true
    		})
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 8.1K bytes
    - Viewed (0)
Back to top