2018-11-28 22:18:09 +00:00
|
|
|
namespace Ryujinx.HLE.HOS.Kernel
|
|
|
|
{
|
|
|
|
class KMemoryBlockAllocator
|
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
private ulong CapacityElements;
|
2018-11-28 22:18:09 +00:00
|
|
|
|
|
|
|
public int Count { get; set; }
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public KMemoryBlockAllocator(ulong CapacityElements)
|
2018-11-28 22:18:09 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
this.CapacityElements = CapacityElements;
|
2018-11-28 22:18:09 +00:00
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public bool CanAllocate(int Count)
|
2018-11-28 22:18:09 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
return (ulong)(this.Count + Count) <= CapacityElements;
|
2018-11-28 22:18:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|