Skip to content

Commit 26a9078

Browse files
committed
Added missing file header
1 parent 1dcdb24 commit 26a9078

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

UnitTests/UnitTests.HighPerformance.Shared/Buffers/Internals/UnmanagedSpanOwner.cs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using System;
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
26
using System.Runtime.CompilerServices;
37
using System.Runtime.InteropServices;
48

@@ -31,6 +35,21 @@ public UnmanagedSpanOwner(int size)
3135
this.length = size;
3236
}
3337

38+
/// <summary>
39+
/// Gets the length of the buffer in use.
40+
/// </summary>
41+
public int Length => this.length;
42+
43+
/// <summary>
44+
/// Gets a pointer to the start of the buffer in use.
45+
/// </summary>
46+
public T* Ptr => (T*)this.ptr;
47+
48+
/// <summary>
49+
/// Gets the <see cref="Memory{T}"/> for the current instance.
50+
/// </summary>
51+
public Span<T> Span => new Span<T>((void*)this.ptr, this.length);
52+
3453
/// <inheritdoc/>
3554
public void Dispose()
3655
{
@@ -45,10 +64,5 @@ public void Dispose()
4564

4665
Marshal.FreeHGlobal(ptr);
4766
}
48-
49-
/// <summary>
50-
/// Gets the <see cref="Memory{T}"/> for the current instance.
51-
/// </summary>
52-
public Span<T> Span => new Span<T>((void*)this.ptr, this.length);
5367
}
5468
}

0 commit comments

Comments
 (0)