From c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 19 Apr 2020 17:19:32 -0400 Subject: Inital commit --- .../Scripts/Runtime/TMP_ListPool.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_ListPool.cs (limited to 'Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_ListPool.cs') diff --git a/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_ListPool.cs b/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_ListPool.cs new file mode 100644 index 0000000..0220af2 --- /dev/null +++ b/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_ListPool.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; + + +namespace TMPro +{ + internal static class TMP_ListPool + { + // Object pool to avoid allocations. + private static readonly TMP_ObjectPool> s_ListPool = new TMP_ObjectPool>(null, l => l.Clear()); + + public static List Get() + { + return s_ListPool.Get(); + } + + public static void Release(List toRelease) + { + s_ListPool.Release(toRelease); + } + } +} \ No newline at end of file -- cgit v1.2.3