* Paolo Molaro (lupus@ximian.com)
*
* Copyright 2006-2009 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include "mono/metadata/mono-mlist.h"
#include "mono/metadata/appdomain.h"
#include "mono/metadata/class-internals.h"
+#include "mono/metadata/object-internals.h"
/* matches the System.MonoListItem object*/
struct _MonoMList {
MonoMList*
mono_mlist_alloc (MonoObject *data)
{
+ MonoError error;
MonoMList* res;
if (!monolist_item_vtable) {
- MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoListItem");
+ MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System", "MonoListItem");
monolist_item_vtable = mono_class_vtable (mono_get_root_domain (), klass);
g_assert (monolist_item_vtable);
}
- res = (MonoMList*)mono_object_new_fast (monolist_item_vtable);
+ res = (MonoMList*)mono_object_new_fast_checked (monolist_item_vtable, &error);
+ mono_error_raise_exception (&error);
MONO_OBJECT_SETREF (res, data, data);
return res;
}