Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for stackGrowthRecursive (0.17 sec)

  1. src/runtime/chan_test.go

    	// is set to >= 1.
    	const n = 10
    	c := make(chan int)
    	done := make(chan struct{})
    
    	go func() {
    		for i := 0; i < n; i++ {
    			c <- i
    			// use lots of stack, briefly.
    			stackGrowthRecursive(20)
    		}
    		done <- struct{}{}
    	}()
    
    	for i := 0; i < n; i++ {
    		x := <-c
    		if x != i {
    			t.Errorf("bad channel read: want %d, got %d", i, x)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 31 20:47:35 UTC 2023
    - 23.4K bytes
    - Viewed (0)
  2. src/runtime/proc_test.go

    	<-done // Make sure goroutines exit
    	<-done
    	<-done
    }
    
    var padData [128]uint64
    
    func stackGrowthRecursive(i int) {
    	var pad [128]uint64
    	pad = padData
    	for j := range pad {
    		if pad[j] != 0 {
    			return
    		}
    	}
    	if i != 0 {
    		stackGrowthRecursive(i - 1)
    	}
    }
    
    func TestPreemptSplitBig(t *testing.T) {
    	if testing.Short() {
    		t.Skip("skipping in -short mode")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 14 00:03:57 UTC 2023
    - 25.8K bytes
    - Viewed (0)
Back to top