aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/KMemoryBlockAllocator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/KMemoryBlockAllocator.cs')
-rw-r--r--Ryujinx.HLE/HOS/Kernel/KMemoryBlockAllocator.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/KMemoryBlockAllocator.cs b/Ryujinx.HLE/HOS/Kernel/KMemoryBlockAllocator.cs
new file mode 100644
index 00000000..08512e12
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Kernel/KMemoryBlockAllocator.cs
@@ -0,0 +1,19 @@
+namespace Ryujinx.HLE.HOS.Kernel
+{
+ class KMemoryBlockAllocator
+ {
+ private ulong CapacityElements;
+
+ public int Count { get; set; }
+
+ public KMemoryBlockAllocator(ulong CapacityElements)
+ {
+ this.CapacityElements = CapacityElements;
+ }
+
+ public bool CanAllocate(int Count)
+ {
+ return (ulong)(this.Count + Count) <= CapacityElements;
+ }
+ }
+} \ No newline at end of file