Source file src/internal/runtime/cgobench/funcs.go

     1  // Copyright 2025 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  //go:build cgo
     6  
     7  package cgobench
     8  
     9  /*
    10  static void empty() {
    11  }
    12  
    13  void go_empty_callback();
    14  
    15  static void callback() {
    16  	go_empty_callback();
    17  }
    18  
    19  */
    20  import "C"
    21  
    22  func EmptyC() {
    23  	C.empty()
    24  }
    25  
    26  func CallbackC() {
    27  	C.callback()
    28  }
    29  
    30  //export go_empty_callback
    31  func go_empty_callback() {
    32  }
    33  
    34  //go:noinline
    35  func Empty() {
    36  }
    37  

View as plain text