A game about forced loneliness, made by TACStudios
1using System.Collections.Generic;
2using UnityEngine.Pool;
3
4namespace UnityEditor.Graphing
5{
6 static class StackPool<T>
7 {
8 // Object pool to avoid allocations.
9 static readonly ObjectPool<Stack<T>> k_StackPool = new ObjectPool<Stack<T>>(() => new Stack<T>(), null, l => l.Clear());
10
11 public static Stack<T> Get()
12 {
13 return k_StackPool.Get();
14 }
15
16 public static void Release(Stack<T> toRelease)
17 {
18 k_StackPool.Release(toRelease);
19 }
20 }
21}