aboutsummaryrefslogtreecommitdiff
path: root/lib/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Utils')
-rw-r--r--lib/Utils/src/Memory/MemoryUtil.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Utils/src/Memory/MemoryUtil.cs b/lib/Utils/src/Memory/MemoryUtil.cs
index c4cbc2f..26adf85 100644
--- a/lib/Utils/src/Memory/MemoryUtil.cs
+++ b/lib/Utils/src/Memory/MemoryUtil.cs
@@ -709,6 +709,17 @@ namespace VNLib.Utils.Memory
/// <summary>
/// Gets a <see cref="Span{T}"/> over the block of memory pointed to by the supplied handle.
+ /// reference
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="handle"></param>
+ /// <param name="size">The size of the span (the size of the block)</param>
+ /// <returns>A span over the block of memory pointed to by the handle of the specified size</returns>
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Span<T> GetSpan<T>(ref MemoryHandle handle, int size) => new(handle.Pointer, size);
+
+ /// <summary>
+ /// Gets a <see cref="Span{T}"/> over the block of memory pointed to by the supplied handle.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="handle"></param>