return mono_object_clone (this);
}
+#if HAVE_BOEHM_GC
+#define MONO_OBJECT_ALIGNMENT_SHIFT 3
+#else
+#define MONO_OBJECT_ALIGNMENT_SHIFT 2
+#endif
+
+/*
+ * Return hashcode based on object address. This function will need to be
+ * smarter in the presence of a moving garbage collector, which will cache
+ * the address hash before relocating the object.
+ *
+ * Wang's address-based hash function:
+ * http://www.concentric.net/~Ttwang/tech/addrhash.htm
+ */
static gint32
ves_icall_System_Object_GetHashCode (MonoObject *this)
{
- return *((gint32 *)this - 1);
+ register guint32 key;
+ key = (GPOINTER_TO_UINT (this) >> MONO_OBJECT_ALIGNMENT_SHIFT) * 2654435761u;
+
+ return key & 0x7fffffff;
}
/*
static MonoObject *
ves_icall_InternalInvoke (MonoReflectionMethod *method, MonoObject *this, MonoArray *params)
{
- return mono_runtime_invoke_array (method->method, this, params);
+ return mono_runtime_invoke_array (method->method, this, params, NULL);
}
static MonoObject *
if (!strcmp (method->method->name, ".ctor"))
g_assert_not_reached ();
- result = mono_runtime_invoke_array (method->method, this, params);
+ result = mono_runtime_invoke_array (method->method, this, params, NULL);
*outArgs = out_args;
return names;
}
-int ves_icall_System_Environment_get_TickCount (void);
-
/*
* Returns the number of milliseconds elapsed since the system started.
*/
static gint32
-ves_icall_System_Environment_get_TickCount ()
+ves_icall_System_Environment_get_TickCount (void)
{
#if defined (PLATFORM_WIN32)
return GetTickCount();