diff --git a/csharp/Platform.Memory.Tests/HeapResizableDirectMemoryTests.cs b/csharp/Platform.Memory.Tests/HeapResizableDirectMemoryTests.cs index 9e27d97..1d68a2b 100644 --- a/csharp/Platform.Memory.Tests/HeapResizableDirectMemoryTests.cs +++ b/csharp/Platform.Memory.Tests/HeapResizableDirectMemoryTests.cs @@ -2,8 +2,20 @@ namespace Platform.Memory.Tests { + /// + /// + /// Represents the heap resizable direct memory tests. + /// + /// + /// public unsafe class HeapResizableDirectMemoryTests { + /// + /// + /// Tests that correct memory reallocation test. + /// + /// + /// [Fact] public void CorrectMemoryReallocationTest() { @@ -15,6 +27,20 @@ public void CorrectMemoryReallocationTest() Assert.Equal(0, value1); } + /// + /// + /// Gets the last byte using the specified heap memory. + /// + /// + /// + /// + /// The heap memory. + /// + /// + /// + /// The byte + /// + /// private static byte GetLastByte(HeapResizableDirectMemory heapMemory) { var pointer1 = (void*)heapMemory.Pointer; diff --git a/csharp/Platform.Memory/ArrayMemory.cs b/csharp/Platform.Memory/ArrayMemory.cs index aaa1b7c..0e0ab81 100644 --- a/csharp/Platform.Memory/ArrayMemory.cs +++ b/csharp/Platform.Memory/ArrayMemory.cs @@ -1,4 +1,4 @@ -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; namespace Platform.Memory { @@ -11,6 +11,12 @@ public class ArrayMemory : IArrayMemory { #region Fields + /// + /// + /// The array. + /// + /// + /// private readonly TElement[] _array; #endregion diff --git a/csharp/Platform.Memory/DirectMemoryAsArrayMemoryAdapter.cs b/csharp/Platform.Memory/DirectMemoryAsArrayMemoryAdapter.cs index 4d456c0..650fe40 100644 --- a/csharp/Platform.Memory/DirectMemoryAsArrayMemoryAdapter.cs +++ b/csharp/Platform.Memory/DirectMemoryAsArrayMemoryAdapter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.CompilerServices; using Platform.Disposables; using Platform.Exceptions; @@ -16,6 +16,12 @@ public class DirectMemoryAsArrayMemoryAdapter : DisposableBase, IArray { #region Fields + /// + /// + /// The memory. + /// + /// + /// private readonly IDirectMemory _memory; #endregion diff --git a/csharp/Platform.Memory/FileArrayMemory.cs b/csharp/Platform.Memory/FileArrayMemory.cs index 01ecb31..c3cd061 100644 --- a/csharp/Platform.Memory/FileArrayMemory.cs +++ b/csharp/Platform.Memory/FileArrayMemory.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using System.Runtime.CompilerServices; using Platform.Disposables; using Platform.Unsafe; @@ -16,6 +16,12 @@ public class FileArrayMemory : DisposableBase, IArrayMemory { #region Fields + /// + /// + /// The file. + /// + /// + /// private readonly FileStream _file; #endregion diff --git a/csharp/Platform.Memory/FileMappedResizableDirectMemory.cs b/csharp/Platform.Memory/FileMappedResizableDirectMemory.cs index fb46edd..5c0e435 100644 --- a/csharp/Platform.Memory/FileMappedResizableDirectMemory.cs +++ b/csharp/Platform.Memory/FileMappedResizableDirectMemory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.IO.MemoryMappedFiles; using System.Runtime.CompilerServices; @@ -17,7 +17,19 @@ public unsafe class FileMappedResizableDirectMemory : ResizableDirectMemoryBase { #region Fields + /// + /// + /// The file. + /// + /// + /// private MemoryMappedFile _file; + /// + /// + /// The accessor. + /// + /// + /// private MemoryMappedViewAccessor _accessor; /// @@ -73,6 +85,16 @@ public FileMappedResizableDirectMemory(string path) : this(path, MinimumCapacity #region Methods + /// + /// + /// Maps the file using the specified capacity. + /// + /// + /// + /// + /// The capacity. + /// + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] private void MapFile(long capacity) { @@ -87,6 +109,12 @@ private void MapFile(long capacity) Pointer = new IntPtr(pointer); } + /// + /// + /// Unmaps the file. + /// + /// + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] private void UnmapFile() { @@ -96,6 +124,20 @@ private void UnmapFile() } } + /// + /// + /// Determines whether this instance unmap file. + /// + /// + /// + /// + /// The pointer. + /// + /// + /// + /// The bool + /// + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool UnmapFile(IntPtr pointer) { diff --git a/csharp/Platform.Memory/HeapResizableDirectMemory.cs b/csharp/Platform.Memory/HeapResizableDirectMemory.cs index bc142a6..77262d7 100644 --- a/csharp/Platform.Memory/HeapResizableDirectMemory.cs +++ b/csharp/Platform.Memory/HeapResizableDirectMemory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Platform.Unsafe; diff --git a/csharp/Platform.Memory/IArrayMemory.cs b/csharp/Platform.Memory/IArrayMemory.cs index a556b35..a1d5739 100644 --- a/csharp/Platform.Memory/IArrayMemory.cs +++ b/csharp/Platform.Memory/IArrayMemory.cs @@ -1,4 +1,4 @@ -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; namespace Platform.Memory { diff --git a/csharp/Platform.Memory/IDirectMemory.cs b/csharp/Platform.Memory/IDirectMemory.cs index 0cee0ef..1c8acce 100644 --- a/csharp/Platform.Memory/IDirectMemory.cs +++ b/csharp/Platform.Memory/IDirectMemory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.CompilerServices; namespace Platform.Memory diff --git a/csharp/Platform.Memory/IMemory.cs b/csharp/Platform.Memory/IMemory.cs index f0ca45d..a300369 100644 --- a/csharp/Platform.Memory/IMemory.cs +++ b/csharp/Platform.Memory/IMemory.cs @@ -1,4 +1,4 @@ -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; namespace Platform.Memory { diff --git a/csharp/Platform.Memory/IResizableDirectMemory.cs b/csharp/Platform.Memory/IResizableDirectMemory.cs index 5a81194..61de9cf 100644 --- a/csharp/Platform.Memory/IResizableDirectMemory.cs +++ b/csharp/Platform.Memory/IResizableDirectMemory.cs @@ -1,4 +1,4 @@ -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; namespace Platform.Memory { diff --git a/csharp/Platform.Memory/ResizableDirectMemoryBase.cs b/csharp/Platform.Memory/ResizableDirectMemoryBase.cs index 87950fd..f6145b6 100644 --- a/csharp/Platform.Memory/ResizableDirectMemoryBase.cs +++ b/csharp/Platform.Memory/ResizableDirectMemoryBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using System.Runtime.CompilerServices; using Platform.Exceptions; @@ -25,8 +25,26 @@ public abstract class ResizableDirectMemoryBase : DisposableBase, IResizableDire #region Fields + /// + /// + /// The pointer. + /// + /// + /// private IntPtr _pointer; + /// + /// + /// The reserved capacity. + /// + /// + /// private long _reservedCapacity; + /// + /// + /// The used capacity. + /// + /// + /// private long _usedCapacity; #endregion diff --git a/csharp/Platform.Memory/TemporaryFileMappedResizableDirectMemory.cs b/csharp/Platform.Memory/TemporaryFileMappedResizableDirectMemory.cs index 1099147..e801111 100644 --- a/csharp/Platform.Memory/TemporaryFileMappedResizableDirectMemory.cs +++ b/csharp/Platform.Memory/TemporaryFileMappedResizableDirectMemory.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using System.Runtime.CompilerServices; namespace Platform.Memory