public static Stack <T> ToStackPooled <T>(this IEnumerable <T> source) { var stack = StackPool <T> .New(); foreach (var item in source) { stack.Push(item); } return(stack); }
public static void Free <T>(this Stack <T> stack) { StackPool <T> .Free(stack); }