Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestGcMapIndirection (0.16 sec)

  1. src/runtime/gc_test.go

    	t.Logf("%p", a)
    
    	a[0][0][0][0][0][0][0][0][0][0] = new(int)
    	*a[0][0][0][0][0][0][0][0][0][0] = 13
    	runtime.GC()
    	if *a[0][0][0][0][0][0][0][0][0][0] != 13 {
    		t.Fail()
    	}
    }
    
    func TestGcMapIndirection(t *testing.T) {
    	defer debug.SetGCPercent(debug.SetGCPercent(1))
    	runtime.GC()
    	type T struct {
    		a [256]int
    	}
    	m := make(map[T]T)
    	for i := 0; i < 2000; i++ {
    		var a T
    		a.a[0] = i
    		m[a] = T{}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 22:33:52 UTC 2024
    - 17.6K bytes
    - Viewed (0)
Back to top