-
Notifications
You must be signed in to change notification settings - Fork 18.1k
sync: prevent (*Map).Range from always escaping #62408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR (HEAD: 88c6787) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/524976. Important tips:
|
Message from Ian Lance Taylor: Patch Set 1: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Go LUCI: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2023-09-01T01:40:09Z","revision":"756e6e4e6060ca61836986ff798bade1f4db121d"} Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Ian Lance Taylor: Patch Set 1: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Go LUCI: Patch Set 1: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Go LUCI: Patch Set 1: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Caleb Spare: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Bryan Mills: Patch Set 1: Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
88c6787
to
508a10e
Compare
This PR (HEAD: 508a10e) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/524976. Important tips:
|
Message from Mauri de Souza Meneguzzo: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
After the change from CL 426074 the Range method on Map always escape the read variable, generating an allocation. Since the compiler doesn't do live-range splitting for local variables we need to use some hints to only escape in that particular branch. Fixes golang#62404
508a10e
to
fcbedb4
Compare
Message from Bryan Mills: Patch Set 2: Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
This PR (HEAD: fcbedb4) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/524976. Important tips:
|
Message from Mauri de Souza Meneguzzo: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Bryan Mills: Patch Set 3: Auto-Submit+1 Code-Review+2 Commit-Queue+1 Run-TryBot+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Go LUCI: Patch Set 3: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2023-09-01T18:42:52Z","revision":"da79d9b431a9c70dedf523526e690bee5f84efcc"} Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Gopher Robot: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Bryan Mills: Patch Set 3: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Go LUCI: Patch Set 3: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Go LUCI: Patch Set 3: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
Message from Gopher Robot: Patch Set 3: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/524976. |
After the change from CL 426074 the Range method on Map always escape the read variable, leading to an allocation. Since the compiler doesn't do live-range splitting for local variables we need to use some hints to only escape in that particular branch. Fixes #62404 Change-Id: I938a5e593647455fa827e3dd3ed8ea22c7365df1 GitHub-Last-Rev: fcbedb4 GitHub-Pull-Request: #62408 Reviewed-on: https://go-review.googlesource.com/c/go/+/524976 Auto-Submit: Bryan Mills <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
This PR is being closed because golang.org/cl/524976 has been merged. |
After the change from CL 426074 the Range method on Map always
escape the read variable, leading to an allocation.
Since the compiler doesn't do live-range splitting for local variables we
need to use some hints to only escape in that particular branch.
Fixes #62404