+2003-04-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * Object.cs ValueType.cs: Make the Object::GetHashCode() and
+ ValueType::Equals() icalls static non-virtual, so they can be called
+ by the code in RuntimeHelpers.
+
2003-04-18 Miguel de Icaza <miguel@ximian.com>
* Delegate.cs (operator ==): Do not crash if the second argument
// class should return a hash code that makes sense
// for that particular implementation of the object.
// </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern virtual int GetHashCode ();
+ public virtual int GetHashCode () {
+ return InternalGetHashCode (this);
+ }
// <summary>
// Returns the Type associated with the object.
return (a == b);
}
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ internal static extern int InternalGetHashCode (object o);
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern IntPtr obj_address ();
// True if this instance and o represent the same type
// and have the same value.
// </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override bool Equals (object o);
+ public override bool Equals (object o) {
+ return InternalEquals (this, o);
+ }
// <summary>
// Gets a hashcode for this value type using the
{
return GetType().FullName;
}
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public extern static bool InternalEquals (object o1, object o2);
}
}