mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-19 05:15:55 +01:00
e653848a2c
More up to date build of the JIT Sparse PR for continued development. JIT Sparse Function Table was originally developed by riperiperi for the original Ryujinx project, and decreased the amount of layers in the Function Table structure, to decrease lookup times at the cost of slightly higher RAM usage. This PR rebalances the JIT Sparse Function Table to be a bit more RAM intensive, but faster in workloads where the JIT Function Table is a bottleneck. Faster RAM will see a bigger impact and slower RAM (DDR3 and potentially slow DDR4) will see a slight performance decrease. This PR also implements a base for a PPTC profile system that could allow for PPTC with ExeFS mods enabled in the future. This PR also potentially fixes a strange issue where Avalonia would time out in some rare instances, e.g. when running ExeFS mods with TotK and a strange controller configuration. --------- Co-authored-by: Evan Husted <gr33m11@gmail.com>
28 lines
615 B
C#
28 lines
615 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace ARMeilleure.Common
|
|
{
|
|
public unsafe sealed class NativeAllocator : Allocator
|
|
{
|
|
public static NativeAllocator Instance { get; } = new();
|
|
|
|
public override void* Allocate(ulong size)
|
|
{
|
|
void* result = (void*)Marshal.AllocHGlobal((nint)size);
|
|
|
|
if (result == null)
|
|
{
|
|
throw new OutOfMemoryException();
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
public override void Free(void* block)
|
|
{
|
|
Marshal.FreeHGlobal((nint)block);
|
|
}
|
|
}
|
|
}
|