cmd/compile: implement global new(T) without calling newobject #29691
Labels
Milestone
Comments
No, we still need a write barrier when initializing a global location. The write barriers I changed recently removes them when initializing the contents of the results of a Yes, we can and should allocate the |
Hi @josharian! Can I help? |
Go for it. You'll be looking at sinit.go. It's not particularly clear code, even by compiler standards. I recommend writing yourself a few simplified examples to work off of. |
Sounds lovely. :D But at least I'll learn while trying to figure it out. Which is always good. :) |
Picking this up now. Sorry, was pre-occupied with another issue on packages. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This generates init code to call
newobject
(including a write barrier, which I thought wasn't supposed to happen any more?). Instead, we should make a BSS int symbol, and then makex
contain a relocation to that symbol.cc @randall77 @mvdan
The text was updated successfully, but these errors were encountered: