aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2019-07-01 21:39:22 -0500
committerAc_K <Acoustik666@gmail.com>2019-07-02 04:39:22 +0200
commitb2b736abc2569ab5d8199da666aef8d8394844a0 (patch)
tree88bcc2ae4fb0d4161c95df2cd7edb12388de922a /Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs
parent10c74182babaf8cf6bedaeffd64c3109df4ea816 (diff)
Misc cleanup (#708)
* Fix typos * Remove unneeded using statements * Enforce var style more * Remove redundant qualifiers * Fix some indentation * Disable naming warnings on files with external enum names * Fix build * Mass find & replace for comments with no spacing * Standardize todo capitalization and for/if spacing
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs')
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs26
1 files changed, 13 insertions, 13 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs
index 92cef559..bb4989fc 100644
--- a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs
@@ -126,21 +126,21 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
ulong blockPagesCount = bestFitBlockSize / KMemoryManager.PageSize;
- //Check if this is the best fit for this page size.
- //If so, try allocating as much requested pages as possible.
+ // Check if this is the best fit for this page size.
+ // If so, try allocating as much requested pages as possible.
while (blockPagesCount <= pagesCount)
{
ulong address = AllocatePagesForOrder(blockIndex, backwards, bestFitBlockSize);
- //The address being zero means that no free space was found on that order,
- //just give up and try with the next one.
+ // The address being zero means that no free space was found on that order,
+ // just give up and try with the next one.
if (address == 0)
{
break;
}
- //Add new allocated page(s) to the pages list.
- //If an error occurs, then free all allocated pages and fail.
+ // Add new allocated page(s) to the pages list.
+ // If an error occurs, then free all allocated pages and fail.
KernelResult result = pageList.AddRange(address, blockPagesCount);
if (result != KernelResult.Success)
@@ -159,13 +159,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
}
}
- //Success case, all requested pages were allocated successfully.
+ // Success case, all requested pages were allocated successfully.
if (pagesCount == 0)
{
return KernelResult.Success;
}
- //Error case, free allocated pages and return out of memory.
+ // Error case, free allocated pages and return out of memory.
foreach (KPageNode pageNode in pageList)
{
FreePages(pageNode.Address, pageNode.PagesCount);
@@ -321,8 +321,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
if (address != 0)
{
- //If we are using a larger order than best fit, then we should
- //split it into smaller blocks.
+ // If we are using a larger order than best fit, then we should
+ // split it into smaller blocks.
ulong firstFreeBlockSize = 1UL << block.Order;
if (firstFreeBlockSize > bestFitBlockSize)
@@ -416,7 +416,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
}
}
- //Free inside aligned region.
+ // Free inside aligned region.
ulong baseAddress = addressRounded;
while (baseAddress < endAddrTruncated)
@@ -430,7 +430,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
int nextBlockIndex = blockIndex - 1;
- //Free region between Address and aligned region start.
+ // Free region between Address and aligned region start.
baseAddress = addressRounded;
for (blockIndex = nextBlockIndex; blockIndex >= 0; blockIndex--)
@@ -445,7 +445,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
}
}
- //Free region between aligned region end and End Address.
+ // Free region between aligned region end and End Address.
baseAddress = endAddrTruncated;
for (blockIndex = nextBlockIndex; blockIndex >= 0; blockIndex--)