RoslynClrHeapAllocationAnalyzer
RoslynClrHeapAllocationAnalyzer copied to clipboard
Some Heap Allocation scenarios are going away!
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?
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 :-(
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.