Use the stackalloc keyword
Allocate a memory block on the stack, this memory is not subject to garbage collection, and is automatically released after the method returns
stackalloc can only be used for unmanaged types
Such as
Char * pc = stackalloc Char [10];
// Because it is a pointer type, it must be placed in the Unsafe block