Code demonstrating the importance of a Constrained Execution Region
using System; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; class Program { static bool cerWorked; static void Main( string[] args ) { try { cerWorked = true; MyFn(); } catch( OutOfMemoryException ) { Console.WriteLine( cerWorked ); } Console.ReadLine(); } unsafe struct Big { public fixed byte Bytes[int.MaxValue]; } //results depends on the existance of this attribute [ReliabilityContract( Consistency.WillNotCorruptState, … Read more