Convert uses of the Dangerous APIs to use MemoryMarshal.GetReference (#15532)
authorAhson Khan <ahkha@microsoft.com>
Sat, 16 Dec 2017 06:36:38 +0000 (22:36 -0800)
committerGitHub <noreply@github.com>
Sat, 16 Dec 2017 06:36:38 +0000 (22:36 -0800)
commit8ec9bdfd53220b555f0b19eebd6a2c4ab5dab8bf
tree1289799e79f64bd21eaa55c29d472ed6e1559888
parente2837daec1d3a32aa33942c11d5820b09caafc7b
Convert uses of the Dangerous APIs to use MemoryMarshal.GetReference (#15532)

* Convert uses of the Dangerous APIs to use MemoryMarshal.GetReference

* Adding Unsafe.AsRef(in...) and using that for ReadOnlySpan GetReference

* Fix typo - add missing bracket.

* Change AsRef(ref...) to AsRef(in...)

* Remove unnecessary whitespace

* Remove Unsafe.AsRef(in...) and its uses.

* Revert "Remove unnecessary whitespace"

This reverts commit 4dbe38cae472e868f74afbabde358f3a7609f6ae.

* Revert "Revert "Remove unnecessary whitespace""

This reverts commit 44d79483423ac9ffcf7c566b79d4a42c6aa15dac.

* Remove extra space to fix formatting.
25 files changed:
src/mscorlib/shared/System/BitConverter.cs
src/mscorlib/shared/System/Convert.cs
src/mscorlib/shared/System/Globalization/CompareInfo.cs
src/mscorlib/shared/System/Guid.cs
src/mscorlib/shared/System/IO/FileStream.Unix.cs
src/mscorlib/shared/System/IO/FileStream.Windows.cs
src/mscorlib/shared/System/IO/FileStreamCompletionSource.Win32.cs
src/mscorlib/shared/System/IO/MemoryStream.cs
src/mscorlib/shared/System/IO/UnmanagedMemoryStream.cs
src/mscorlib/shared/System/MemoryDebugView.cs
src/mscorlib/shared/System/Number.Formatting.cs
src/mscorlib/shared/System/Number.Parsing.cs
src/mscorlib/shared/System/Text/Decoder.cs
src/mscorlib/shared/System/Text/Encoder.cs
src/mscorlib/shared/System/Text/Encoding.cs
src/mscorlib/shared/System/Text/StringBuilder.cs
src/mscorlib/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs
src/mscorlib/src/Microsoft/Win32/Win32Native.cs
src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs
src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs
src/mscorlib/src/System/IO/BinaryReader.cs
src/mscorlib/src/System/IO/Stream.cs
src/mscorlib/src/System/String.cs
src/vm/metasig.h
tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs