-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
doc/asm: clarify that get_tls only works in runtime package #33054
Comments
It seems to me that macro moved to a runtime header file But I will defer to some experts to confirm if my diagnosis is correct @ianlancetaylor @randall77 |
Hi, thanks for your reply. Code like this:
outputs:
|
Only the runtime package's go_asm.h defines the offsets of the runtime data structures, like g_m. When you run |
The asm documentation should be clarified to explain that this code only works within the runtime package itself. We do not want to support this outside of the runtime package. |
Hi, I've submitted a pr #33069 , please take a look. |
Change https://golang.org/cl/185917 mentions this issue: |
@ianlancetaylor Hi, I think this is a fix for the doc, and should be released asap. Therefore, maybe the milestone should be go1.13 instead? |
The milestone doesn't mean that it has to wait for 1.14. It only means that it should be resolved before 1.14 comes out. I'm fine with getting a fix into 1.13, but I would like @robpike to take a look at the CL (if he hasn't already). |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm studying go asm, and want to write a demo to get the *g.
According to the doc, I should be able to get *g using code like this:
What did you expect to see?
Successfully get current g's address.
What did you see instead?
The text was updated successfully, but these errors were encountered: