summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAhson Khan <ahkha@microsoft.com>2017-12-15 22:36:38 -0800
committerGitHub <noreply@github.com>2017-12-15 22:36:38 -0800
commit8ec9bdfd53220b555f0b19eebd6a2c4ab5dab8bf (patch)
tree1289799e79f64bd21eaa55c29d472ed6e1559888 /tests
parente2837daec1d3a32aa33942c11d5820b09caafc7b (diff)
downloadcoreclr-8ec9bdfd53220b555f0b19eebd6a2c4ab5dab8bf.tar.gz
coreclr-8ec9bdfd53220b555f0b19eebd6a2c4ab5dab8bf.tar.bz2
coreclr-8ec9bdfd53220b555f0b19eebd6a2c4ab5dab8bf.zip
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs b/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs
index 63f59e04be..82583ad1e2 100644
--- a/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs
@@ -67,7 +67,7 @@ namespace Span
[MethodImpl(MethodImplOptions.NoInlining)]
static byte TestRef(Span<byte> data)
{
- ref byte p = ref data.DangerousGetPinnableReference();
+ ref byte p = ref MemoryMarshal.GetReference(data);
int length = data.Length;
byte x = 0;
@@ -102,7 +102,7 @@ namespace Span
[MethodImpl(MethodImplOptions.NoInlining)]
static unsafe byte TestFixed1(Span<byte> data)
{
- fixed (byte* pData = &data.DangerousGetPinnableReference())
+ fixed (byte* pData = &MemoryMarshal.GetReference(data))
{
int length = data.Length;
byte x = 0;
@@ -140,7 +140,7 @@ namespace Span
[MethodImpl(MethodImplOptions.NoInlining)]
static unsafe byte TestFixed2(Span<byte> data)
{
- fixed (byte* pData = &data.DangerousGetPinnableReference())
+ fixed (byte* pData = &MemoryMarshal.GetReference(data))
{
int length = data.Length;
byte x = 0;