Source file src/runtime/testdata/testprogcgo/bigstack_windows.go

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  /*
     8  typedef void callback(char*);
     9  extern void CallGoBigStack1(char*);
    10  extern void bigStack(callback*);
    11  */
    12  import "C"
    13  
    14  func init() {
    15  	register("BigStack", BigStack)
    16  }
    17  
    18  func BigStack() {
    19  	// Create a large thread stack and call back into Go to test
    20  	// if Go correctly determines the stack bounds.
    21  	C.bigStack((*C.callback)(C.CallGoBigStack1))
    22  }
    23  
    24  //export goBigStack1
    25  func goBigStack1(x *C.char) {
    26  	println("OK")
    27  }
    28  

View as plain text