Skip to content

Commit

Permalink
Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
terminal-cs committed Oct 7, 2022
1 parent d78365f commit c1707b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Tests/Kernels/MemoryOperationsTest/Kernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ protected override void Run()
TestCopy();
TestMemoryBlock(new MemoryBlock(0x60000, 128)); //we are testing in SVGA video memory which should not be in use
TestManagedMemoryBlock(new ManagedMemoryBlock(128));
TestRealloc();
SpanTest.Execute();
TestController.Completed();
}
Expand Down
8 changes: 4 additions & 4 deletions source/Cosmos.Core/Memory/Heap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ public static unsafe void Init()
// Get existing size
uint Size = (RAT.GetPageType(aPtr) == RAT.PageType.HeapSmall ? ((ushort*)aPtr)[-2] : ((uint*)aPtr)[-4]);

if (Size == NewSize)
if (Size == newSize)
{
// Return existing pointer as nothing needs to be done.
return aPtr;
}
if (Size > NewSize)
if (Size > newSize)
{
Size -= (NewSize - Size);
Size -= (newSize - Size);
}

// Allocate a new buffer to use
byte* ToReturn = Alloc(NewSize);
byte* ToReturn = Alloc(newSize);

// Copy the old buffer to the new one
MemoryOperations.Copy(ToReturn, aPtr, (int)Size);
Expand Down

0 comments on commit c1707b8

Please sign in to comment.