Csharp/CSharp Tutorial/unsafe/stackalloc

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Alloate a chuck on the stack

You can allocate memory from the stack by using stackalloc.

stackalloc can be used only when initializing local variables.

stackalloc has this general form:


<source lang="csharp">type *p = stackalloc type[size]</source>