ThreadStaticArray.cs 352 B

1234567891011121314151617181920
  1. using System;
  2. namespace Ryujinx.Common.Pools
  3. {
  4. public static class ThreadStaticArray<T>
  5. {
  6. [ThreadStatic]
  7. private static T[] _array;
  8. public static ref T[] Get()
  9. {
  10. if (_array == null)
  11. {
  12. _array = new T[1];
  13. }
  14. return ref _array;
  15. }
  16. }
  17. }