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

Refactor Unsafe.cs to get it more in sync with CoreRT. #15510

Merged
merged 7 commits into from
Dec 14, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Format the document.
  • Loading branch information
ahsonkhan committed Dec 13, 2017
commit a99d8993db302399d85db74ded5e7ff2021681b6
8 changes: 4 additions & 4 deletions src/mscorlib/src/Internal/Runtime/CompilerServices/Unsafe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static void WriteUnaligned<T>(void* destination, T value)
typeof(T).ToString(); // Type token used by the actual method body
throw new InvalidOperationException();
}

/// <summary>
/// Writes a value of type <typeparamref name="T"/> to the given location.
/// </summary>
Expand All @@ -189,7 +189,7 @@ public static void WriteUnaligned<T>(ref byte destination, T value)
throw new InvalidOperationException();
}

#region NotInCoreRT
#region NotInCoreRT
// These APIs are not available in CoreRT - https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/Internal/Runtime/CompilerServices/Unsafe.cs

/// <summary>
Expand All @@ -204,7 +204,7 @@ public static ref T AsRef<T>(void* source)
throw new InvalidOperationException();
}


/// <summary>
/// Determines the byte offset from origin to target from the given references.
/// </summary>
Expand All @@ -216,6 +216,6 @@ public static IntPtr ByteOffset<T>(ref T origin, ref T target)
// See getILIntrinsicImplementationForUnsafe for how this happens.
throw new InvalidOperationException();
}
#endregion
#endregion
}
}