ErrorProne.NET
ErrorProne.NET copied to clipboard
NoHeapAllocations
Add an attribute NoHeapAllocation and AllowHeapAllocation.
User can put an attribute on assembly, class or member level. If the attribute is present than the member should follow some heap allocation rule. If the rule is saying that allocations are prohibited, analyzer will warn an any heap allocations.
See controlflow stuff as an example here: https://github.com/controlflow/resharper-heapview
I would love this analyzer. Very useful for Unity programming or any other C#-gamedev.
Consider implementing this rule in the PerformanceSensitiveAnalyzer package in dotnet/roslyn-analyzers, which is designed for this purpose.