diff options
Diffstat (limited to 'src/Ryujinx.Common/Pools/SharedPools.cs')
-rw-r--r-- | src/Ryujinx.Common/Pools/SharedPools.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Ryujinx.Common/Pools/SharedPools.cs b/src/Ryujinx.Common/Pools/SharedPools.cs new file mode 100644 index 00000000..b4860b85 --- /dev/null +++ b/src/Ryujinx.Common/Pools/SharedPools.cs @@ -0,0 +1,17 @@ +namespace Ryujinx.Common +{ + public static class SharedPools + { + private static class DefaultPool<T> + where T : class, new() + { + public static readonly ObjectPool<T> Instance = new ObjectPool<T>(() => new T(), 20); + } + + public static ObjectPool<T> Default<T>() + where T : class, new() + { + return DefaultPool<T>.Instance; + } + } +} |