Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#stackalloc and the stackSingle-choice MCQ

When you write `Span<byte> b = stackalloc byte[128];` inside a loop body, what does the C# compiler / runtime guarantee about the stack space across iterations?

for (int i = 0; i < n; i++) { Span<byte> b = stackalloc byte[128]; Use(b); }