Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Issue 169040043: cmd/gc: permit link-time init of zeroed copy in pure Go...

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 5 months ago by iant
Modified:
9 years, 5 months ago
Reviewers:
Visibility:
Public.

Description

cmd/gc: permit link-time init of zeroed copy in pure Go package For code like var y = x var x int the compiler can initialize x at link time, rather than using an init-time assignment. The compiler used to also initialize y at link time, but that does not work if x is actually initialized in C or assembly code. See issue 7665 and https://codereview.appspot.com/93200044/ . However, for pure Go code, we can safely initialize initialize y at link time. This tweaks the fix for issue 7665 so that we initialize y at link time if we know that there is no C or assembly code in the package.

Patch Set 1 #

Patch Set 2 : diff -r 53ebc70d4e9f843cb718f173e3225e9a0fc121e2 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M src/cmd/gc/sinit.c View 1 1 chunk +1 line, -1 line 0 comments Download

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b