mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-16 18:15:25 +00:00
28 lines
625 B
C#
28 lines
625 B
C#
|
using System;
|
|||
|
|
|||
|
namespace Ryujinx.HLE.HOS.Kernel.Memory
|
|||
|
{
|
|||
|
struct KScopedPageList : IDisposable
|
|||
|
{
|
|||
|
private readonly KMemoryManager _manager;
|
|||
|
private KPageList _pageList;
|
|||
|
|
|||
|
public KScopedPageList(KMemoryManager manager, KPageList pageList)
|
|||
|
{
|
|||
|
_manager = manager;
|
|||
|
_pageList = pageList;
|
|||
|
pageList.IncrementPagesReferenceCount(manager);
|
|||
|
}
|
|||
|
|
|||
|
public void SignalSuccess()
|
|||
|
{
|
|||
|
_pageList = null;
|
|||
|
}
|
|||
|
|
|||
|
public void Dispose()
|
|||
|
{
|
|||
|
_pageList?.DecrementPagesReferenceCount(_manager);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|