示例#1
0
        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);
        }
示例#2
0
 public static void Free <T>(this Stack <T> stack)
 {
     StackPool <T> .Free(stack);
 }