2005-06-06 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Mon, 6 Jun 2005 14:12:38 +0000 (14:12 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 6 Jun 2005 14:12:38 +0000 (14:12 -0000)
* GC.cs UnhandledExceptionEventArgs.cs IntPtr.cs RuntimeFieldHandle.cs
  String.cs Object.cs Math.cs RuntimeMethodHandle.cs ModuleHandle.cs
  RuntimeTypeHandle.cs AppDomain.cs: Add some missing 2.0 methods/attributes.

svn path=/trunk/mcs/; revision=45487

mcs/class/corlib/System/AppDomain.cs
mcs/class/corlib/System/GC.cs
mcs/class/corlib/System/IntPtr.cs
mcs/class/corlib/System/Math.cs
mcs/class/corlib/System/ModuleHandle.cs
mcs/class/corlib/System/Object.cs
mcs/class/corlib/System/RuntimeFieldHandle.cs
mcs/class/corlib/System/RuntimeMethodHandle.cs
mcs/class/corlib/System/RuntimeTypeHandle.cs
mcs/class/corlib/System/String.cs
mcs/class/corlib/System/UnhandledExceptionEventArgs.cs

index 8b970130c543a0259aea5509e6943157f078058d..a3bbe76e8b1264762060ace13a17a97da59bc3e3 100644 (file)
@@ -50,6 +50,10 @@ using System.Security.Policy;
 using System.Security.Principal;
 using System.Configuration.Assemblies;
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System
 {
        [ClassInterface(ClassInterfaceType.None)]
@@ -769,6 +773,9 @@ namespace System
                }
 
                [SecurityPermission (SecurityAction.Demand, ControlAppDomain = true)]
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.MayCorruptAppDomain, Cer.MayFail)]
+#endif
                public static void Unload (AppDomain domain)
                {
                        if (domain == null)
@@ -999,6 +1006,9 @@ namespace System
                }
 
                public int Id {
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                        get { return getDomainID (); }
                }
 
index be719173bab94d19a442950fe91bd735d71b812c..273981d6c5d603f57f94aa503f38bbaf2306a9b0 100644 (file)
@@ -102,6 +102,22 @@ namespace System
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static void WaitForPendingFinalizers ();
-               
+
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+               [MonoTODO]
+               public static int CollectionCount (int generation) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static void AddMemoryPressure (long bytesAllocated) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static void RemoveMemoryPressure (long bytesAllocated) {
+                       throw new NotImplementedException ();
+               }
+
        }
 }
index ac7a77780f66250373045181f5b1e8726bd13844..aab0523d7dde83b7043eb9c8c751554ef174322d 100644 (file)
@@ -86,6 +86,9 @@ namespace System
                }
 
                public static int Size {
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                        get {
                                return sizeof (void *);
                        }
@@ -129,6 +132,9 @@ namespace System
                }
 
                [CLSCompliant (false)]
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                unsafe public void *ToPointer ()
                {
                        return value;
index e9ac0b5160ca57a862919a55f56e9caa0bd0af6e..3335b32b6e9034b9b2259c14ceaf05b8eb5d6b8b 100644 (file)
@@ -463,6 +463,9 @@ namespace System
                public extern static double Pow (double x, double y);
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public extern static double Sqrt (double x);
        }
 }
index 9f90c7a305444298d0b7d90a6bf9ce6368d6510e..8121dd0d67f927048e5c492e1300544e7d750888 100644 (file)
@@ -36,6 +36,8 @@ using System.Runtime.CompilerServices;
 
 #if NET_2_0
 
+using System.Runtime.ConstrainedExecution;
+
 namespace System
 {
        [CLSCompliant (false)]
@@ -116,6 +118,9 @@ namespace System
                        return ResolveTypeHandle (typeToken);
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public override bool Equals (object obj)
                {
                        if (obj == null || GetType () != obj.GetType ())
@@ -124,6 +129,9 @@ namespace System
                        return value == ((ModuleHandle)obj).Value;
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public bool Equals (ModuleHandle handle)
                {
                        return value == handle.Value;
index fcc9f494606acbb7d8f2eba27b5e08033e3eccd1..a1031a0de1559021a955e05c2f89963abd7875c2 100644 (file)
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System {
 
        [Serializable]
@@ -73,6 +77,9 @@ namespace System {
                // <summary>
                //   Object destructor. 
                // </summary>
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                ~Object ()
                {
                }
@@ -114,6 +121,9 @@ namespace System {
                //   Tests whether a is equal to b.
                //   Can not figure out why this even exists
                // </summary>
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public static bool ReferenceEquals (object a, object b)
                {
                        return (a == b);
index e18e60ead7ff9f119493006f86ced80cb4ff9066..dcaba2303de191f50af07e206c30dc7b76efffb7 100644 (file)
 using System.Reflection;
 using System.Runtime.Serialization;
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System
 {
        [MonoTODO ("Serialization needs tests")]
@@ -72,7 +76,9 @@ namespace System
                        info.AddValue ("FieldObj", (MonoField) FieldInfo.GetFieldFromHandle (this), typeof (MonoField));
                }
 
-
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public override bool Equals (object obj)
                {
                        if (obj == null || GetType () != obj.GetType ())
@@ -81,6 +87,9 @@ namespace System
                        return value == ((RuntimeFieldHandle)obj).Value;
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public bool Equals (RuntimeFieldHandle handle)
                {
                        return value == handle.Value;
index a1cb242a8a4f8542f9f0d472b66eddbe0d28cdab..905e96939691b98910183a733a5e8670100c83b5 100644 (file)
@@ -33,6 +33,10 @@ using System.Runtime.Serialization;
 using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System
 {
        [MonoTODO ("Serialization needs tests")]
@@ -81,6 +85,9 @@ namespace System
                        return GetFunctionPointer (value);
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public override bool Equals (object obj)
                {
                        if (obj == null || GetType () != obj.GetType ())
@@ -89,6 +96,9 @@ namespace System
                        return value == ((RuntimeMethodHandle)obj).Value;
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public bool Equals (RuntimeMethodHandle handle)
                {
                        return value == handle.Value;
index 4a4cabd60bb0ad71eb359c9d5513fb308376e5fa..6e2752258068746d850303099580848610e48a2c 100644 (file)
 
 using System.Runtime.Serialization;
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System
 {
        [MonoTODO ("Serialization needs tests")]
@@ -71,7 +75,9 @@ namespace System
                        info.AddValue ("TypeObj", Type.GetTypeHandle (this), typeof (MonoType));
                }
 
-
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public override bool Equals (object obj)
                {
                        if (obj == null || GetType () != obj.GetType ())
@@ -80,6 +86,9 @@ namespace System
                        return value == ((RuntimeTypeHandle)obj).Value;
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public bool Equals (RuntimeTypeHandle handle)
                {
                        return value == handle.Value;
@@ -92,6 +101,7 @@ namespace System
 
 #if NET_2_0
                [CLSCompliant (false)]
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
                public ModuleHandle GetModuleHandle () {
                        return Type.GetTypeFromHandle (this).Module.ModuleHandle;
                }
index ded23980dde96e6123a20b6933292d229cfa9159..6c64da47f9155aa8d6e8046acf9f2f9f03f2e0db 100644 (file)
@@ -36,6 +36,10 @@ using System.Collections;
 using System.Globalization;
 using System.Runtime.CompilerServices;
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System
 {
        [Serializable]
@@ -101,11 +105,17 @@ namespace System
                        return !Equals (a, b);
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
                public override bool Equals (Object obj)
                {
                        return Equals (this, obj as String);
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
                public bool Equals (String value)
                {
                        return Equals (this, value);
@@ -1496,6 +1506,9 @@ namespace System
                        }
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
                public unsafe override int GetHashCode ()
                {
                        fixed (char * c = this) {
index 2e18f89df7ffcae4326b8a358338d6445be89042..345239abc8ab4fb1c24460a52d657d3a8cdac0bd 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System 
 {
        [Serializable]
@@ -45,12 +49,18 @@ namespace System
                }
 
                public object ExceptionObject {
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                        get {
                                return exception;
                        }
                }
 
                public bool IsTerminating {
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                        get {
                                return m_isTerminating;
                        }