Skip to content
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

Methods where all paths allocate should be shown as allocations (optional) #16

Open
viktor-svub opened this issue Dec 16, 2014 · 5 comments

Comments

@viktor-svub
Copy link

If this is possible with R# engine... Currently a simple generic static factory hides the allocation.

@controlflow
Copy link
Owner

Can you please clarify?
Do you want allocations analyzer to be intra-procedural or something?

@viktor-svub
Copy link
Author

I'm not sure if the R# SDK allows to "annotate" an analyzed method with custom information - but if it was possible, it would allow to pass the information up the call tree, i.e. mark a method as "always allocating" and show it as such, w/o additional analysis.

@ltrzesniewski
Copy link

Maybe it would be easier to support a manual annotation, like an [Allocates] attribute on a method which allocates (using the same annotation mechanism than other R# attributes like [NotNull]).

@viktor-svub
Copy link
Author

I would expect the manual annotation way to be very brittle, depending on the author to correctly inspect all paths in the fist place, and 3rd-party annotations being invalidated by allocations optimized away, e.g. when rewriting a yield enumerator to a struct-based one.

@ltrzesniewski
Copy link

Yes, I wouldn't put these annotations everywhere. They'd just be for a few methods I know to be expensive. And for those I'd prefer a false positive than a false negative anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants