1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-10-01 12:30:00 +02:00
Ryujinx/Ryujinx.HLE/OsHle/Handles/HSharedMem.cs

44 lines
1 KiB
C#
Raw Normal View History

using ChocolArm64.Memory;
using System;
using System.Collections.Generic;
namespace Ryujinx.HLE.OsHle.Handles
2018-02-05 00:08:20 +01:00
{
class HSharedMem
{
private List<(AMemory, long)> Positions;
public EventHandler<EventArgs> MemoryMapped;
public EventHandler<EventArgs> MemoryUnmapped;
2018-02-05 00:08:20 +01:00
public HSharedMem()
2018-02-05 00:08:20 +01:00
{
Positions = new List<(AMemory, long)>();
}
public void AddVirtualPosition(AMemory Memory, long Position)
{
lock (Positions)
{
Positions.Add((Memory, Position));
MemoryMapped?.Invoke(this, EventArgs.Empty);
}
}
public void RemoveVirtualPosition(AMemory Memory, long Position)
{
lock (Positions)
{
Positions.Remove((Memory, Position));
MemoryUnmapped?.Invoke(this, EventArgs.Empty);
}
}
public (AMemory, long)[] GetVirtualPositions()
{
return Positions.ToArray();
2018-02-05 00:08:20 +01:00
}
}
}