Imported Upstream version 5.12.0.220

Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-04-24 09:31:23 +00:00
parent 8bd104cef2
commit 8fc30896db
1200 changed files with 29534 additions and 26161 deletions

View File

@ -10,7 +10,7 @@ namespace System.Buffers
/// <summary>
/// Provides a mechanism for manual lifetime management.
/// </summary>
interface IRetainable
public interface IRetainable
{
/// <summary>
/// Call this method to indicate that the IRetainable object is in use.

View File

@ -10,7 +10,7 @@ namespace System.Buffers
/// <summary>
/// A handle for the memory.
/// </summary>
unsafe struct MemoryHandle : IDisposable
public unsafe struct MemoryHandle : IDisposable
{
private IRetainable _retainable;
private void* _pointer;

View File

@ -10,7 +10,7 @@ namespace System.Buffers
/// <summary>
/// Owner of Memory<typeparamref name="T"/> that provides appropriate lifetime management mechanisms for it.
/// </summary>
abstract class OwnedMemory<T> : IDisposable, IRetainable
public abstract class OwnedMemory<T> : IDisposable, IRetainable
{
/// <summary>
/// The number of items in the Memory<typeparamref name="T"/>.

View File

@ -8,7 +8,9 @@ using System.Runtime.Serialization;
namespace System.Collections.Generic
{
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public class KeyNotFoundException : SystemException
{
public KeyNotFoundException()

View File

@ -4,6 +4,7 @@
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Runtime.CompilerServices;
namespace System.Collections.Generic
@ -17,7 +18,9 @@ namespace System.Collections.Generic
[DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public class List<T> : IList<T>, System.Collections.IList, IReadOnlyList<T>
{
private const int DefaultCapacity = 4;
@ -445,7 +448,11 @@ namespace System.Collections.Generic
int newCapacity = _items.Length == 0 ? DefaultCapacity : _items.Length * 2;
// Allow the list to grow to maximum possible capacity (~2G elements) before encountering overflow.
// Note that this check works even when _items.Length overflowed thanks to the (uint) cast
#if MONO //in mono we don't want to add additional fields to Array
if ((uint)newCapacity > Array_ReferenceSources.MaxArrayLength) newCapacity = Array_ReferenceSources.MaxArrayLength;
#else
if ((uint)newCapacity > Array.MaxArrayLength) newCapacity = Array.MaxArrayLength;
#endif
if (newCapacity < min) newCapacity = min;
Capacity = newCapacity;
}
@ -1170,6 +1177,9 @@ namespace System.Collections.Generic
}
}
#if MONO
[System.Serializable]
#endif
public struct Enumerator : IEnumerator<T>, System.Collections.IEnumerator
{
private List<T> _list;

View File

@ -10,7 +10,9 @@ namespace System.Collections.ObjectModel
[Serializable]
[DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public class Collection<T> : IList<T>, IList, IReadOnlyList<T>
{
private IList<T> items; // Do not rename (binary serialization)

View File

@ -10,7 +10,9 @@ namespace System.Collections.ObjectModel
[Serializable]
[DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public class ReadOnlyCollection<T> : IList<T>, IList, IReadOnlyList<T>
{
private IList<T> list; // Do not rename (binary serialization)

View File

@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System.Diagnostics.Private;
namespace System.Globalization
{

View File

@ -13,7 +13,7 @@
////////////////////////////////////////////////////////////////////////////
using System.Reflection;
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
@ -34,7 +34,9 @@ namespace System.Globalization
}
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public partial class CompareInfo : IDeserializationCallback
{
// Mask used to check if IndexOf()/LastIndexOf()/IsPrefix()/IsPostfix() has the right flags.
@ -344,7 +346,11 @@ namespace System.Globalization
return String.CompareOrdinal(string1, string2);
}
#if MONO
return internal_compare_switch(string1, 0, string1.Length, string2, 0, string2.Length, options);
#else
return CompareString(string1.AsReadOnlySpan(), string2.AsReadOnlySpan(), options);
#endif
}
// TODO https://github.com/dotnet/coreclr/issues/13827:
@ -525,10 +531,14 @@ namespace System.Globalization
return CompareOrdinal(string1, offset1, length1, string2, offset2, length2);
}
#if MONO
return internal_compare_switch(string1, offset1, length1, string2, offset2, length2, options);
#else
return CompareString(
string1.AsReadOnlySpan().Slice(offset1, length1),
string2.AsReadOnlySpan().Slice(offset2, length2),
options);
#endif
}
private static int CompareOrdinal(string string1, int offset1, int length1, string string2, int offset2, int length2)

View File

@ -239,7 +239,7 @@ namespace System
/// Returns a handle for the array.
/// <param name="pin">If pin is true, the GC will not move the array and hence its address can be taken</param>
/// </summary>
unsafe MemoryHandle Retain(bool pin = false)
public unsafe MemoryHandle Retain(bool pin = false)
{
MemoryHandle memoryHandle = default;
if (pin)

View File

@ -217,7 +217,7 @@ namespace System
/// If pin is true, the GC will not move the array until the returned <see cref="MemoryHandle"/>
/// is disposed, enabling the memory's address can be taken and used.
/// </param>
unsafe MemoryHandle Retain(bool pin = false)
public unsafe MemoryHandle Retain(bool pin = false)
{
MemoryHandle memoryHandle = default;
if (pin)

View File

@ -5,6 +5,9 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
#if MONO
[System.SerializableAttribute]
#endif
public sealed class AsyncStateMachineAttribute : StateMachineAttribute
{
public AsyncStateMachineAttribute(Type stateMachineType)

View File

@ -5,6 +5,9 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.All, Inherited = true)]
#if MONO
[System.SerializableAttribute]
#endif
public sealed class CompilerGeneratedAttribute : Attribute
{
public CompilerGeneratedAttribute() { }

View File

@ -7,6 +7,9 @@ namespace System.Runtime.CompilerServices
// Attribute used to communicate to the VS7 debugger that a class should be treated as if it has global scope.
[AttributeUsage(AttributeTargets.Class)]
#if MONO
[System.SerializableAttribute]
#endif
public class CompilerGlobalScopeAttribute : Attribute
{
public CompilerGlobalScopeAttribute() { }

View File

@ -5,6 +5,9 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
#if MONO
[System.SerializableAttribute]
#endif
public abstract class CustomConstantAttribute : Attribute
{
public abstract Object Value { get; }

View File

@ -5,6 +5,9 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
#if MONO
[System.SerializableAttribute]
#endif
public sealed class DateTimeConstantAttribute : CustomConstantAttribute
{
private DateTime _date;

View File

@ -7,6 +7,9 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
#if MONO
[System.SerializableAttribute]
#endif
public sealed class DecimalConstantAttribute : Attribute
{
private Decimal _dec;

View File

@ -5,6 +5,9 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Field)]
#if MONO
[System.SerializableAttribute]
#endif
public sealed class FixedAddressValueTypeAttribute : Attribute
{
public FixedAddressValueTypeAttribute() { }

View File

@ -5,6 +5,9 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Property, Inherited = true)]
#if MONO
[System.SerializableAttribute]
#endif
public sealed class IndexerNameAttribute : Attribute
{
public IndexerNameAttribute(String indexerName)

View File

@ -5,6 +5,9 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
#if MONO
[System.SerializableAttribute]
#endif
public sealed class IteratorStateMachineAttribute : StateMachineAttribute
{
public IteratorStateMachineAttribute(Type stateMachineType)

Some files were not shown because too many files have changed in this diff Show More