NvMapHandle.cs 751 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Threading;
  2. namespace Ryujinx.HLE.HOS.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. public long DmaMapAddress;
  14. private long _dupes;
  15. public NvMapHandle()
  16. {
  17. _dupes = 1;
  18. }
  19. public NvMapHandle(int size) : this()
  20. {
  21. Size = size;
  22. }
  23. public void IncrementRefCount()
  24. {
  25. Interlocked.Increment(ref _dupes);
  26. }
  27. public long DecrementRefCount()
  28. {
  29. return Interlocked.Decrement(ref _dupes);
  30. }
  31. }
  32. }