misc: Avoid copy of ApplicationControlProperty (#4849)

Avoid more giant copy when passing it around.
This commit is contained in:
Mary 2023-05-08 01:50:07 +02:00 committed by GitHub
parent adf4ebcd60
commit 0e06aace45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 16 deletions

View File

@ -116,7 +116,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
device, device,
device.System.KernelContext, device.System.KernelContext,
metaLoader, metaLoader,
nacpData.Value, nacpData,
enablePtc, enablePtc,
allowCodeMemoryForJit, allowCodeMemoryForJit,
programName, programName,

View File

@ -209,7 +209,7 @@ namespace Ryujinx.HLE.Loaders.Processes
ProcessResult processResult = ProcessLoaderHelper.LoadNsos(_device, ProcessResult processResult = ProcessLoaderHelper.LoadNsos(_device,
_device.System.KernelContext, _device.System.KernelContext,
dummyExeFs.GetNpdm(), dummyExeFs.GetNpdm(),
nacpData.Value, nacpData,
diskCacheEnabled: false, diskCacheEnabled: false,
allowCodeMemoryForJit: true, allowCodeMemoryForJit: true,
programName, programName,

View File

@ -219,7 +219,7 @@ namespace Ryujinx.HLE.Loaders.Processes
Switch device, Switch device,
KernelContext context, KernelContext context,
MetaLoader metaLoader, MetaLoader metaLoader,
ApplicationControlProperty applicationControlProperties, BlitStruct<ApplicationControlProperty> applicationControlProperties,
bool diskCacheEnabled, bool diskCacheEnabled,
bool allowCodeMemoryForJit, bool allowCodeMemoryForJit,
string name, string name,
@ -355,7 +355,7 @@ namespace Ryujinx.HLE.Loaders.Processes
context.Device.System.TickSource, context.Device.System.TickSource,
context.Device.Gpu, context.Device.Gpu,
$"{programId:x16}", $"{programId:x16}",
applicationControlProperties.DisplayVersionString.ToString(), applicationControlProperties.Value.DisplayVersionString.ToString(),
diskCacheEnabled, diskCacheEnabled,
codeStart, codeStart,
codeSize); codeSize);

View File

@ -1,4 +1,5 @@
using LibHac.Loader; using LibHac.Common;
using LibHac.Loader;
using LibHac.Ns; using LibHac.Ns;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Cpu; using Ryujinx.Cpu;
@ -11,7 +12,7 @@ namespace Ryujinx.HLE.Loaders.Processes
{ {
public class ProcessResult public class ProcessResult
{ {
public static ProcessResult Failed => new(null, new ApplicationControlProperty(), false, false, null, 0, 0, 0, TitleLanguage.AmericanEnglish); public static ProcessResult Failed => new(null, new BlitStruct<ApplicationControlProperty>(1), false, false, null, 0, 0, 0, TitleLanguage.AmericanEnglish);
private readonly byte _mainThreadPriority; private readonly byte _mainThreadPriority;
private readonly uint _mainThreadStackSize; private readonly uint _mainThreadStackSize;
@ -31,15 +32,15 @@ namespace Ryujinx.HLE.Loaders.Processes
public readonly bool AllowCodeMemoryForJit; public readonly bool AllowCodeMemoryForJit;
public ProcessResult( public ProcessResult(
MetaLoader metaLoader, MetaLoader metaLoader,
ApplicationControlProperty applicationControlProperties, BlitStruct<ApplicationControlProperty> applicationControlProperties,
bool diskCacheEnabled, bool diskCacheEnabled,
bool allowCodeMemoryForJit, bool allowCodeMemoryForJit,
IDiskCacheLoadState diskCacheLoadState, IDiskCacheLoadState diskCacheLoadState,
ulong pid, ulong pid,
byte mainThreadPriority, byte mainThreadPriority,
uint mainThreadStackSize, uint mainThreadStackSize,
TitleLanguage titleLanguage) TitleLanguage titleLanguage)
{ {
_mainThreadPriority = mainThreadPriority; _mainThreadPriority = mainThreadPriority;
_mainThreadStackSize = mainThreadStackSize; _mainThreadStackSize = mainThreadStackSize;
@ -48,7 +49,7 @@ namespace Ryujinx.HLE.Loaders.Processes
ProcessId = pid; ProcessId = pid;
MetaLoader = metaLoader; MetaLoader = metaLoader;
ApplicationControlProperties = applicationControlProperties; ApplicationControlProperties = applicationControlProperties.Value;
if (metaLoader is not null) if (metaLoader is not null)
{ {