mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-30 17:32:23 -05:00
misc: chore: Fix object creation in HLE project
This commit is contained in:
@@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
_blocksCount = blockShifts.Length;
|
||||
_blocks = new Block[_memoryBlockPageShifts.Length];
|
||||
|
||||
ArraySegment<ulong> currBitmapStorage = new ArraySegment<ulong>(new ulong[CalculateManagementOverheadSize(size, blockShifts)]);
|
||||
ArraySegment<ulong> currBitmapStorage = new(new ulong[CalculateManagementOverheadSize(size, blockShifts)]);
|
||||
|
||||
for (int i = 0; i < blockShifts.Length; i++)
|
||||
{
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
bool shouldFillPages,
|
||||
byte fillValue)
|
||||
{
|
||||
using KScopedPageList scopedPageList = new KScopedPageList(Context.MemoryManager, pageList);
|
||||
using KScopedPageList scopedPageList = new(Context.MemoryManager, pageList);
|
||||
|
||||
ulong currentVa = address;
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
}
|
||||
}
|
||||
|
||||
using KScopedPageList scopedPageList = new KScopedPageList(Context.MemoryManager, pageList);
|
||||
using KScopedPageList scopedPageList = new(Context.MemoryManager, pageList);
|
||||
|
||||
foreach (KPageNode pageNode in pageList)
|
||||
{
|
||||
|
||||
@@ -617,7 +617,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
return result;
|
||||
}
|
||||
|
||||
using OnScopeExit _ = new OnScopeExit(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager));
|
||||
using OnScopeExit _ = new(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager));
|
||||
|
||||
return MapPages(address, pageList, permission, MemoryMapFlags.Private);
|
||||
}
|
||||
@@ -769,7 +769,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
|
||||
Result result = region.AllocatePages(out KPageList pageList, pagesCount);
|
||||
|
||||
using OnScopeExit _ = new OnScopeExit(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager));
|
||||
using OnScopeExit _ = new(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager));
|
||||
|
||||
void CleanUpForError()
|
||||
{
|
||||
@@ -1341,7 +1341,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
|
||||
Result result = region.AllocatePages(out KPageList pageList, remainingPages);
|
||||
|
||||
using OnScopeExit _ = new OnScopeExit(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager));
|
||||
using OnScopeExit _ = new(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager));
|
||||
|
||||
void CleanUpForError()
|
||||
{
|
||||
@@ -1867,7 +1867,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
ulong dstLastPagePa = 0;
|
||||
ulong currentVa = va;
|
||||
|
||||
using OnScopeExit _ = new OnScopeExit(() =>
|
||||
using OnScopeExit _ = new(() =>
|
||||
{
|
||||
if (dstFirstPagePa != 0)
|
||||
{
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||
|
||||
KProcess process = new(_context);
|
||||
|
||||
using OnScopeExit _ = new OnScopeExit(process.DecrementReferenceCount);
|
||||
using OnScopeExit _ = new(process.DecrementReferenceCount);
|
||||
|
||||
KResourceLimit resourceLimit;
|
||||
|
||||
@@ -1425,7 +1425,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||
|
||||
KCodeMemory codeMemory = new(_context);
|
||||
|
||||
using OnScopeExit _ = new OnScopeExit(codeMemory.DecrementReferenceCount);
|
||||
using OnScopeExit _ = new(codeMemory.DecrementReferenceCount);
|
||||
|
||||
KProcess currentProcess = KernelStatic.GetCurrentProcess();
|
||||
|
||||
|
||||
@@ -1232,7 +1232,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||
{
|
||||
if (_schedulerWaitEvent == null)
|
||||
{
|
||||
ManualResetEvent schedulerWaitEvent = new ManualResetEvent(false);
|
||||
ManualResetEvent schedulerWaitEvent = new(false);
|
||||
|
||||
if (Interlocked.Exchange(ref _schedulerWaitEvent, schedulerWaitEvent) == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user