ErrorProne.NET icon indicating copy to clipboard operation
ErrorProne.NET copied to clipboard

NoHeapAllocations

Open SergeyTeplyakov opened this issue 10 years ago • 2 comments

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

SergeyTeplyakov avatar Nov 30 '15 04:11 SergeyTeplyakov

I would love this analyzer. Very useful for Unity programming or any other C#-gamedev.

dogfuntom avatar Feb 27 '16 17:02 dogfuntom

Consider implementing this rule in the PerformanceSensitiveAnalyzer package in dotnet/roslyn-analyzers, which is designed for this purpose.

sharwell avatar Apr 08 '19 13:04 sharwell