Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Some Heap Allocation scenarios are going away! #8

Open
mattwarren opened this issue Mar 12, 2015 · 2 comments
Open

Some Heap Allocation scenarios are going away! #8

mattwarren opened this issue Mar 12, 2015 · 2 comments

Comments

@mattwarren
Copy link
Contributor

I don't know if you've seen this or not, but seems like Microsoft are getting rid of some of the scenarios that this analyser picks up.

Other than removing them as these things are added to Roslyn, I wonder how to handle this in the future? Does the analyser need to detect which version of the compiler it's running against and behave differently, or is there a smarter way?

@mjsabby
Copy link
Contributor

mjsabby commented Mar 20, 2015

The "correct" way is to look at the IL, but that is expensive.

This is a corner case that we'll have to now model :-(

@mattwarren
Copy link
Contributor Author

The "correct" way is to look at the IL, but that is expensive.

That's what I feared. BTW before I came across your analysers, I had a go at doing just this. I used Roslyn to compile the code and then Cecil to get the IL so it could be analysed.

And yes, you're right, it's expensive, even with Roslyn compiling in-memory.

edespong added a commit to edespong/RoslynClrHeapAllocationAnalyzer that referenced this issue Dec 14, 2017
Roslyn does not pick up these conversions, so we have to explicitly handle them.

Added unit test and changed old tests to account for the change.
mjsabby pushed a commit that referenced this issue Mar 26, 2018
Do not report boxing for optimized value types (#8)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants