mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-27 17:07:10 +02:00
memory: Add Android support
This commit is contained in:
parent
c27a12df2c
commit
0b14eb3a61
4 changed files with 36 additions and 16 deletions
|
@ -8,6 +8,7 @@ namespace Ryujinx.Memory
|
|||
{
|
||||
[SupportedOSPlatform("linux")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
[SupportedOSPlatform("android")]
|
||||
static class MemoryManagementUnix
|
||||
{
|
||||
private static readonly ConcurrentDictionary<IntPtr, ulong> _allocations = new();
|
||||
|
@ -156,6 +157,22 @@ namespace Ryujinx.Memory
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (OperatingSystem.IsAndroid())
|
||||
{
|
||||
byte[] memName = Encoding.ASCII.GetBytes("Ryujinx-XXXXXX");
|
||||
|
||||
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