Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for usestack1 (0.39 sec)

  1. test/fixedbugs/issue13169.go

    // license that can be found in the LICENSE file.
    
    package main
    
    type T struct {
    	a, b, c int
    }
    
    func usestack() {
    	usestack1(32)
    }
    func usestack1(d int) byte {
    	if d == 0 {
    		return 0
    	}
    	var b [1024]byte
    	usestack1(d - 1)
    	return b[3]
    }
    
    const n = 100000
    
    func main() {
    	c := make(chan interface{})
    	done := make(chan bool)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 703 bytes
    - Viewed (0)
  2. test/fixedbugs/issue32288.go

    	}
    }
    
    func main() {
    	defer func() {
    		useStack(100) // force a stack copy
    		// We're expecting a panic.
    		// The bug in this issue causes a throw, which this recover() will not squash.
    		recover()
    	}()
    	junk() // fill the stack with invalid pointers
    	f(nil, nil)
    }
    
    func useStack(n int) {
    	if n == 0 {
    		return
    	}
    	useStack(n - 1)
    }
    
    //go:noinline
    func junk() uintptr {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 21:52:17 UTC 2019
    - 809 bytes
    - Viewed (0)
  3. test/fixedbugs/issue40629.go

    	// overwrite x on the garbage stack.
    	defer func() {
    		c := make(chan bool)
    		go func() {
    			useStack(1000)
    			c <- true
    		}()
    		<-c
    
    	}()
    
    	// This defer causes a stack copy.
    	// The old stack is now garbage.
    	defer func() {
    		useStack(1000)
    	}()
    
    	// Trigger a segfault.
    	*g = 0
    
    	// Make the return statement unreachable.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 14 21:49:36 UTC 2020
    - 1.2K bytes
    - Viewed (0)
  4. test/fixedbugs/issue63657.go

    package main
    
    type T struct {
    	a, b int
    }
    
    //go:noinline
    func f(x *T, p *bool, n int) {
    	*p = n != 0
    	useStack(1000)
    	g(&x.b)
    }
    
    //go:noinline
    func g(p *int) {
    }
    
    func useStack(n int) {
    	if n == 0 {
    		return
    	}
    	useStack(n - 1)
    }
    
    func main() {
    	mustPanic(func() {
    		var b bool
    		f(nil, &b, 3)
    	})
    }
    
    func mustPanic(f func()) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 31 20:45:54 UTC 2023
    - 677 bytes
    - Viewed (0)
  5. test/fixedbugs/issue16760.go

    }
    
    type F func(W)
    
    func foo(f F) {
    	defer func() {
    		if r := recover(); r != nil {
    			usestack(1000)
    		}
    	}()
    	f(nil)
    }
    
    func main() {
    	foo(func(w W) {
    		var x []string
    		w.Write([]byte(x[5]))
    	})
    }
    
    func usestack(n int) {
    	if n == 0 {
    		return
    	}
    	usestack(n - 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 22 22:53:51 UTC 2021
    - 796 bytes
    - Viewed (0)
  6. src/runtime/testdata/testprogcgo/bigstack_windows.c

    static callback *bigStackCallback;
    
    static void useStack(int bytes) {
    	// Windows doesn't like huge frames, so we grow the stack 64k at a time.
    	char x[64<<10];
    	if (bytes < sizeof x) {
    		bigStackCallback(x);
    	} else {
    		useStack(bytes - sizeof x);
    	}
    }
    
    static DWORD WINAPI threadEntry(LPVOID lpParam) {
    	useStack(STACK_SIZE - (128<<10));
    	return 0;
    }
    
    void bigStack(callback *cb) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 02 15:18:26 UTC 2018
    - 1.2K bytes
    - Viewed (0)
  7. src/runtime/stack_test.go

    	if n == 0 {
    		f()
    		return
    	}
    	var b [1024]byte // makes frame about 1KB
    	useStackAndCall(n-1+int(b[99]), f)
    }
    
    func useStack(n int) {
    	useStackAndCall(n, func() {})
    }
    
    func growing(c chan int, done chan struct{}) {
    	for n := range c {
    		useStack(n)
    		done <- struct{}{}
    	}
    	done <- struct{}{}
    }
    
    func TestStackCache(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 14 00:03:57 UTC 2023
    - 23.1K bytes
    - Viewed (0)
  8. src/reflect/all_test.go

    	target := func(in []Value) []Value {
    		runtime.GC()
    		useStack(16)
    		return []Value{ValueOf(9)}
    	}
    
    	var concrete func(*int, int) int
    	fn := MakeFunc(ValueOf(concrete).Type(), target)
    	ValueOf(&concrete).Elem().Set(fn)
    	x := concrete(nil, 7)
    	if x != 9 {
    		t.Errorf("have %#q want 9", x)
    	}
    }
    
    // use about n KB of stack
    func useStack(n int) {
    	if n == 0 {
    		return
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top