Skip to content

Commit

Permalink
doc/go1.22: mention new #cgo directives
Browse files Browse the repository at this point in the history
For #56378

Change-Id: I0c9c662c6d765cad6f7bf17fdd648db8d73e429b
Reviewed-on: https://go-review.googlesource.com/c/go/+/522937
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
  • Loading branch information
ianlancetaylor authored and gopherbot committed Aug 26, 2023
1 parent 789b3f8 commit 59abd0e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions doc/go1.22.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ <h3 id="go-command">Go command</h3>
TODO: complete this section, or delete if not needed
</p>

<h3 id="cgo">Cgo</h3>

<p><!-- CL 497837 --> The special comment that precedes
<code>import</code> <code>"C"</code> may now include two
new <code>#cgo</code> directives.
<ul>
<li>
<code>#cgo</code> <code>noescape</code> <code>cFunctionName</code>
tells cgo that Go pointers passed to the C function
<code>cFunctionName</code> do not escape.
</li>
<li>
<code>#cgo</code> <code>nocallback</code> <code>cFunctionName</code>
tells cgo that the C function <code>cFunctionName</code> does
not call any Go functions.
</li>
</ul>
See <a href="/cmd/cgo#hdr-Optimizing_calls_of_C_code">the <code>cgo</code>
documentation</a> for more details.
</p>

<h2 id="runtime">Runtime</h2>

<p>
Expand Down

0 comments on commit 59abd0e

Please sign in to comment.