using System.Collections.Generic; using UnityEngine.Pool; namespace UnityEditor.Graphing { static class StackPool { // Object pool to avoid allocations. static readonly ObjectPool> k_StackPool = new ObjectPool>(() => new Stack(), null, l => l.Clear()); public static Stack Get() { return k_StackPool.Get(); } public static void Release(Stack toRelease) { k_StackPool.Release(toRelease); } } }