NvMapHandle.cs 723 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Threading;
  2. namespace Ryujinx.HLE.OsHle.Services.Nv.NvMap
  3. {
  4. class NvMapHandle
  5. {
  6. public int Handle;
  7. public int Id;
  8. public int Size;
  9. public int Align;
  10. public int Kind;
  11. public long Address;
  12. public bool Allocated;
  13. private long Dupes;
  14. public NvMapHandle()
  15. {
  16. Dupes = 1;
  17. }
  18. public NvMapHandle(int Size) : this()
  19. {
  20. this.Size = Size;
  21. }
  22. public void IncrementRefCount()
  23. {
  24. Interlocked.Increment(ref Dupes);
  25. }
  26. public long DecrementRefCount()
  27. {
  28. return Interlocked.Decrement(ref Dupes) + 1;
  29. }
  30. }
  31. }