Skip to content

golang extension: optimization: added noescape and nocallback directives for C functions. - #29396

Merged
wbpcode merged 2 commits into
envoyproxy:mainfrom
mosn:go-noescape
Sep 7, 2023
Merged

golang extension: optimization: added noescape and nocallback directives for C functions.#29396
wbpcode merged 2 commits into
envoyproxy:mainfrom
mosn:go-noescape

Conversation

@doujiang24

Copy link
Copy Markdown
Member

they could prevent the Go compiler from allocating function parameters on the heap.

noescape and nocallback are new go1.22 cgo directives that help the Go compiler make better decisions. See golang/go#56378 for more context.

…ves for C functions.

they could prevent the Go compiler from allocating function parameters on the heap.

Signed-off-by: doujiang24 <doujiang24@gmail.com>
Comment thread contrib/golang/filters/http/source/go/pkg/http/capi_impl.go Outdated
Comment thread contrib/golang/filters/http/source/go/pkg/http/cgo_go122.go
Signed-off-by: doujiang24 <doujiang24@gmail.com>
@doujiang24

Copy link
Copy Markdown
Member Author

/retest

@doujiang24

Copy link
Copy Markdown
Member Author

seems the tests failed due to a bad network?

ERROR: An error occurred during the fetch of repository 'boringssl':
   Traceback (most recent call last):
	File "/home/runner/.cache/bazel/_bazel_runner/02539c6c583a07d8a5de0e5505565d64/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
		download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/google/boringssl/archive/88d7a40bd06a34da6ee0d985545755199d047258.tar.gz] to /home/runner/.cache/bazel/_bazel_runner/02539c6c583a07d8a5de0e5505565d64/external/boringssl/temp95[28](https://github.com/envoyproxy/envoy/actions/runs/6072484811/job/16474468365?pr=29396#step:4:29)405596523223581/88d7a40bd06a34da6ee0d985545755199d047258.tar.gz: java.net.SocketTimeoutException: Read timed out

https://github.com/envoyproxy/envoy/actions/runs/6072484811/job/16474468365?pr=29396

@doujiang24

Copy link
Copy Markdown
Member Author

/retest

1 similar comment
@doujiang24

Copy link
Copy Markdown
Member Author

/retest

@doujiang24

Copy link
Copy Markdown
Member Author

/retest

@doujiang24

Copy link
Copy Markdown
Member Author

ci is happy now, it's good to merge. cc @wbpcode

@wbpcode wbpcode left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@wbpcode
wbpcode merged commit d1b6788 into envoyproxy:main Sep 7, 2023
spacewander pushed a commit to spacewander/envoy that referenced this pull request Sep 19, 2023
…ves for C functions. (envoyproxy#29396)

* golang extension: optimization: added noescape and nocallback directives for C functions.

they could prevent the Go compiler from allocating function parameters on the heap.

Signed-off-by: doujiang24 <doujiang24@gmail.com>

* add comment for the magic number.

Signed-off-by: doujiang24 <doujiang24@gmail.com>

---------

Signed-off-by: doujiang24 <doujiang24@gmail.com>
@doujiang24
doujiang24 deleted the go-noescape branch October 12, 2023 14:56
johnlanni pushed a commit to johnlanni/envoy that referenced this pull request Mar 25, 2025
…ves for C functions. (envoyproxy#29396)

* golang extension: optimization: added noescape and nocallback directives for C functions.

they could prevent the Go compiler from allocating function parameters on the heap.

Signed-off-by: doujiang24 <doujiang24@gmail.com>

* add comment for the magic number.

Signed-off-by: doujiang24 <doujiang24@gmail.com>

---------

Signed-off-by: doujiang24 <doujiang24@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants