Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2018-01-03 20:54:35 +0300
committerGitHub <noreply@github.com>2018-01-03 20:54:35 +0300
commit975765dbabf177958e8c4278811d5947fd302211 (patch)
treeefcd283771f9925de47d20f647762bc9479a345c /mcs/class/referencesource
parent3826a69bc0c194e7598e4a7bbdfd829bbc802a34 (diff)
Bump corefx (#6119)
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r--mcs/class/referencesource/mscorlib/system/bitconverter.cs13
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/compilerservices/RuntimeWrappedException.cs5
-rw-r--r--mcs/class/referencesource/mscorlib/system/text/encoding.cs10
-rw-r--r--mcs/class/referencesource/mscorlib/system/throwhelper.cs1
4 files changed, 27 insertions, 2 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/bitconverter.cs b/mcs/class/referencesource/mscorlib/system/bitconverter.cs
index 49d20cd6697..5c1e45160c3 100644
--- a/mcs/class/referencesource/mscorlib/system/bitconverter.cs
+++ b/mcs/class/referencesource/mscorlib/system/bitconverter.cs
@@ -472,7 +472,18 @@ namespace System {
// If we ever run on big endian machines, produce two versions where endianness is specified.
Contract.Assert(IsLittleEndian, "This method is implemented assuming little endian with an ambiguous spec.");
return *((double*)&value);
- }
+ }
+
+#if MONO
+ // Converts a Span into an int
+ public static int ToInt32(ReadOnlySpan<byte> value)
+ {
+ if (value.Length < sizeof(int))
+ ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.value);
+ return Unsafe.ReadUnaligned<int>(ref value.DangerousGetPinnableReference());
+ }
+#endif
+
}
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/RuntimeWrappedException.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/RuntimeWrappedException.cs
index 14f68188d05..e747c5b92ec 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/RuntimeWrappedException.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/RuntimeWrappedException.cs
@@ -23,7 +23,10 @@ namespace System.Runtime.CompilerServices {
[Serializable]
public sealed class RuntimeWrappedException : Exception
{
- private RuntimeWrappedException(Object thrownObject)
+#if MONO
+ public
+#endif
+ RuntimeWrappedException(Object thrownObject)
: base(Environment.GetResourceString("RuntimeWrappedException")) {
SetErrorCode(System.__HResults.COR_E_RUNTIMEWRAPPED);
m_wrappedException = thrownObject;
diff --git a/mcs/class/referencesource/mscorlib/system/text/encoding.cs b/mcs/class/referencesource/mscorlib/system/text/encoding.cs
index 3180f250c2e..bd1b75f72cd 100644
--- a/mcs/class/referencesource/mscorlib/system/text/encoding.cs
+++ b/mcs/class/referencesource/mscorlib/system/text/encoding.cs
@@ -1359,6 +1359,16 @@ namespace System.Text
return String.CreateStringFromEncoding(bytes, byteCount, this);
}
+#if MONO
+ public unsafe string GetString(ReadOnlySpan<byte> bytes)
+ {
+ fixed (byte* bytesPtr = &bytes.DangerousGetPinnableReference())
+ {
+ return GetString(bytesPtr, bytes.Length);
+ }
+ }
+#endif
+
// Returns the code page identifier of this encoding. The returned value is
// an integer between 0 and 65535 if the encoding has a code page
// identifier, or -1 if the encoding does not represent a code page.
diff --git a/mcs/class/referencesource/mscorlib/system/throwhelper.cs b/mcs/class/referencesource/mscorlib/system/throwhelper.cs
index 0eea324a960..95a5bb12487 100644
--- a/mcs/class/referencesource/mscorlib/system/throwhelper.cs
+++ b/mcs/class/referencesource/mscorlib/system/throwhelper.cs
@@ -475,6 +475,7 @@ namespace System {
pointer,
ownedMemory,
text,
+ length,
#endif
}