C#


ROSLYN.RELIABILITY.CA2014 : Do not use stackalloc in loops (C#)

See Roslyn-Detected C# Warning Classes for more information.

Summary

Stack space allocated by a stackalloc is only released at the end of the current method's invocation. Using it in a loop can result in unbounded stack growth and eventual stack overflow conditions.

This check corresponds to Roslyn rule CA2014. For full rule details, see the Microsoft website: CA2014.

Properties

Class Name Do not use stackalloc in loops (C#)
Significance reliability
Mnemonic ROSLYN.RELIABILITY.CA2014
Categories None
Availability Available for C# only.
Enabling Checks for this warning class are enabled by default. To disable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Do not use stackalloc in loops (C#)"

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.