Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Mark MemoryMarshal.Cast methods for aggressive inlining #16654

Merged
merged 1 commit into from
Feb 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static Memory<T> AsMemory<T>(ReadOnlyMemory<T> readOnlyMemory) =>
/// <exception cref="System.ArgumentException">
/// Thrown when <typeparamref name="TFrom"/> or <typeparamref name="TTo"/> contains pointers.
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Span<TTo> Cast<TFrom, TTo>(Span<TFrom> source)
where TFrom : struct
where TTo : struct
Expand All @@ -75,6 +76,7 @@ ref Unsafe.As<TFrom, TTo>(ref source._pointer.Value),
/// <exception cref="System.ArgumentException">
/// Thrown when <typeparamref name="TFrom"/> or <typeparamref name="TTo"/> contains pointers.
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ReadOnlySpan<TTo> Cast<TFrom, TTo>(ReadOnlySpan<TFrom> source)
where TFrom : struct
where TTo : struct
Expand Down