Skip to content

Commit

Permalink
Automatically generated XML-comment stubs are added.
Browse files Browse the repository at this point in the history
  • Loading branch information
FreePhoenix888 committed Aug 22, 2021
1 parent 00c6606 commit 116a3e5
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 11 deletions.
26 changes: 26 additions & 0 deletions csharp/Platform.Memory.Tests/HeapResizableDirectMemoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@

namespace Platform.Memory.Tests
{
/// <summary>
/// <para>
/// Represents the heap resizable direct memory tests.
/// </para>
/// <para></para>
/// </summary>
public unsafe class HeapResizableDirectMemoryTests
{
/// <summary>
/// <para>
/// Tests that correct memory reallocation test.
/// </para>
/// <para></para>
/// </summary>
[Fact]
public void CorrectMemoryReallocationTest()
{
Expand All @@ -15,6 +27,20 @@ public void CorrectMemoryReallocationTest()
Assert.Equal(0, value1);
}

/// <summary>
/// <para>
/// Gets the last byte using the specified heap memory.
/// </para>
/// <para></para>
/// </summary>
/// <param name="heapMemory">
/// <para>The heap memory.</para>
/// <para></para>
/// </param>
/// <returns>
/// <para>The byte</para>
/// <para></para>
/// </returns>
private static byte GetLastByte(HeapResizableDirectMemory heapMemory)
{
var pointer1 = (void*)heapMemory.Pointer;
Expand Down
8 changes: 7 additions & 1 deletion csharp/Platform.Memory/ArrayMemory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;

namespace Platform.Memory
{
Expand All @@ -11,6 +11,12 @@ public class ArrayMemory<TElement> : IArrayMemory<TElement>
{
#region Fields

/// <summary>
/// <para>
/// The array.
/// </para>
/// <para></para>
/// </summary>
private readonly TElement[] _array;

#endregion
Expand Down
8 changes: 7 additions & 1 deletion csharp/Platform.Memory/DirectMemoryAsArrayMemoryAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Runtime.CompilerServices;
using Platform.Disposables;
using Platform.Exceptions;
Expand All @@ -16,6 +16,12 @@ public class DirectMemoryAsArrayMemoryAdapter<TElement> : DisposableBase, IArray
{
#region Fields

/// <summary>
/// <para>
/// The memory.
/// </para>
/// <para></para>
/// </summary>
private readonly IDirectMemory _memory;

#endregion
Expand Down
8 changes: 7 additions & 1 deletion csharp/Platform.Memory/FileArrayMemory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System.Runtime.CompilerServices;
using Platform.Disposables;
using Platform.Unsafe;
Expand All @@ -16,6 +16,12 @@ public class FileArrayMemory<TElement> : DisposableBase, IArrayMemory<TElement>
{
#region Fields

/// <summary>
/// <para>
/// The file.
/// </para>
/// <para></para>
/// </summary>
private readonly FileStream _file;

#endregion
Expand Down
44 changes: 43 additions & 1 deletion csharp/Platform.Memory/FileMappedResizableDirectMemory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Runtime.CompilerServices;
Expand All @@ -17,7 +17,19 @@ public unsafe class FileMappedResizableDirectMemory : ResizableDirectMemoryBase
{
#region Fields

/// <summary>
/// <para>
/// The file.
/// </para>
/// <para></para>
/// </summary>
private MemoryMappedFile _file;
/// <summary>
/// <para>
/// The accessor.
/// </para>
/// <para></para>
/// </summary>
private MemoryMappedViewAccessor _accessor;

/// <summary>
Expand Down Expand Up @@ -73,6 +85,16 @@ public FileMappedResizableDirectMemory(string path) : this(path, MinimumCapacity

#region Methods

/// <summary>
/// <para>
/// Maps the file using the specified capacity.
/// </para>
/// <para></para>
/// </summary>
/// <param name="capacity">
/// <para>The capacity.</para>
/// <para></para>
/// </param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void MapFile(long capacity)
{
Expand All @@ -87,6 +109,12 @@ private void MapFile(long capacity)
Pointer = new IntPtr(pointer);
}

/// <summary>
/// <para>
/// Unmaps the file.
/// </para>
/// <para></para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void UnmapFile()
{
Expand All @@ -96,6 +124,20 @@ private void UnmapFile()
}
}

/// <summary>
/// <para>
/// Determines whether this instance unmap file.
/// </para>
/// <para></para>
/// </summary>
/// <param name="pointer">
/// <para>The pointer.</para>
/// <para></para>
/// </param>
/// <returns>
/// <para>The bool</para>
/// <para></para>
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool UnmapFile(IntPtr pointer)
{
Expand Down
2 changes: 1 addition & 1 deletion csharp/Platform.Memory/HeapResizableDirectMemory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Platform.Unsafe;
Expand Down
2 changes: 1 addition & 1 deletion csharp/Platform.Memory/IArrayMemory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;

namespace Platform.Memory
{
Expand Down
2 changes: 1 addition & 1 deletion csharp/Platform.Memory/IDirectMemory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Runtime.CompilerServices;

namespace Platform.Memory
Expand Down
2 changes: 1 addition & 1 deletion csharp/Platform.Memory/IMemory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;

namespace Platform.Memory
{
Expand Down
2 changes: 1 addition & 1 deletion csharp/Platform.Memory/IResizableDirectMemory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;

namespace Platform.Memory
{
Expand Down
20 changes: 19 additions & 1 deletion csharp/Platform.Memory/ResizableDirectMemoryBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Runtime.CompilerServices;
using Platform.Exceptions;
Expand All @@ -25,8 +25,26 @@ public abstract class ResizableDirectMemoryBase : DisposableBase, IResizableDire

#region Fields

/// <summary>
/// <para>
/// The pointer.
/// </para>
/// <para></para>
/// </summary>
private IntPtr _pointer;
/// <summary>
/// <para>
/// The reserved capacity.
/// </para>
/// <para></para>
/// </summary>
private long _reservedCapacity;
/// <summary>
/// <para>
/// The used capacity.
/// </para>
/// <para></para>
/// </summary>
private long _usedCapacity;

#endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System.Runtime.CompilerServices;

namespace Platform.Memory
Expand Down

0 comments on commit 116a3e5

Please sign in to comment.