mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-16 13:37:03 +00:00
Android: Memory specific switches
This commit is contained in:
parent
846b5b6e8a
commit
98b4ff331c
5 changed files with 46 additions and 16 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Runtime.InteropServices;
|
||||
|
|
@ -8,6 +9,7 @@ namespace Ryujinx.Memory
|
|||
{
|
||||
[SupportedOSPlatform("linux")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
[SupportedOSPlatform("android")]
|
||||
static class MemoryManagementUnix
|
||||
{
|
||||
private static readonly ConcurrentDictionary<IntPtr, ulong> _allocations = new();
|
||||
|
|
@ -156,6 +158,24 @@ namespace Ryujinx.Memory
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (Ryujinx.Common.PlatformInfo.IsBionic)
|
||||
{
|
||||
byte[] memName = "Ryujinx-XXXXXX"u8.ToArray();
|
||||
|
||||
Logger.Debug?.Print(LogClass.Cpu, $"Creating Android SharedMemory of size:{size}");
|
||||
|
||||
fixed (byte* pMemName = memName)
|
||||
{
|
||||
fd = ASharedMemory_create((IntPtr)pMemName, (nuint)size);
|
||||
if (fd <= 0)
|
||||
{
|
||||
throw new OutOfMemoryException();
|
||||
}
|
||||
}
|
||||
|
||||
// ASharedMemory_create handle ftruncate for us.
|
||||
return (IntPtr)fd;
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] fileName = "/dev/shm/Ryujinx-XXXXXX"u8.ToArray();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue