-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Escape analysis #231
Comments
What is your use case? How would you like to see it? Can you show me an example output of this command? I wonder if it's really useful to integrate this. |
This features may be quite handy. Here's a sample output:
That could go nicely into the quickfix window and we could jump to the appropriate files:lines from it :) |
Hm, if the std output of |
That actually makes sense :) Not to mention there are other interesting flags, "-s" being my favourite :) as it complains about redundant type definitions. Given the code: package main
type dummy struct {
whatever int
}
var dummies = []dummy{
dummy{1},
dummy{2},
dummy{3},
}
var smarties = []dummy{
{1},
{2},
{3},
}
func main() {} running
|
This is merged via @alexaandru PR #237. |
Escape analysis gives about 1-4 lines per each variable and function argument. Giving them all to the user is not going to help. I was thinking about highlighting escaped variables only, for example. |
When building go program with flag
-gcflags=-m
, e.g.go install -v -gcflags=-m
, compiler will print info about variables\arguments that escape and are allocated on heap. These variables increase pressure on garbage collector, so one should change code for these variables to be allocated on stack.Giving information about escaped variables in vim would be very useful.
The text was updated successfully, but these errors were encountered: