RoslynClrHeapAllocationAnalyzer icon indicating copy to clipboard operation
RoslynClrHeapAllocationAnalyzer copied to clipboard

Some Heap Allocation scenarios are going away!

Open mattwarren opened this issue 10 years ago • 2 comments

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?

mattwarren avatar Mar 12 '15 11:03 mattwarren

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 :-(

mjsabby avatar Mar 20 '15 05:03 mjsabby

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.

mattwarren avatar Mar 20 '15 20:03 mattwarren