"SkipLocalsInit Example"

// Following code will only write "Found a non-zero byte" when [SkipLocalsInit] is applied

[SkipLocalsInit]
public static void Main() {
	Span<byte> stackData = stackalloc byte[4000];
	for (var i = 0; i < stackData.Length; ++i) {
		if (stackData[i] != 0) {
			Console.WriteLine("Found a non-zero byte!");
			break;
		}
	}
}


Code snippet taken from "Two Decades of C#: A Reference - C# 9".