Making sure mono_marshal_free is used instead of g_free in mono_string_builder_to_utf8
[mono.git] / mcs / class / corlib / System.Runtime.InteropServices / ArrayWithOffset.cs
index 590e9ad00d76e7d5c6d9fc4b3457d307bc33d004..1ad70d3908570182c34ee842383531a49d5bbcd7 100644 (file)
@@ -33,6 +33,8 @@ using System;
 
 namespace System.Runtime.InteropServices {
 
+       [Serializable]
+       [ComVisible (true)]
        public struct ArrayWithOffset {
                object array;
                int offset;
@@ -54,6 +56,21 @@ namespace System.Runtime.InteropServices {
                        return (other.array == array && other.offset == offset);
                }
 
+               public bool Equals (ArrayWithOffset obj)
+               {
+                       return obj.array == array && obj.offset == offset;
+               }
+
+               public static bool operator == (ArrayWithOffset a, ArrayWithOffset b)
+               {
+                       return a.Equals (b);
+               }
+
+               public static bool operator != (ArrayWithOffset a, ArrayWithOffset b)
+               {
+                       return !a.Equals (b);
+               }
+
                public override int GetHashCode ()
                {
                        return offset;