Ryujinx/Ryujinx.HLE/HOS/Kernel/KMemoryBlockAllocator.cs

19 lines
431 B
C#
Raw Normal View History

namespace Ryujinx.HLE.HOS.Kernel
{
class KMemoryBlockAllocator
{
2018-12-01 21:01:59 +01:00
private ulong _capacityElements;
public int Count { get; set; }
2018-12-01 21:01:59 +01:00
public KMemoryBlockAllocator(ulong capacityElements)
{
2018-12-01 21:01:59 +01:00
this._capacityElements = capacityElements;
}
2018-12-01 21:01:59 +01:00
public bool CanAllocate(int count)
{
2018-12-01 21:01:59 +01:00
return (ulong)(this.Count + count) <= _capacityElements;
}
}
}