提交 ad128f58 编写于 作者: A Alex Thibodeau 提交者: Dharmendra Tomar

Expose mono_class_is_open_constructed_type to Unity to allow us to check to...

Expose mono_class_is_open_constructed_type to Unity to allow us to check to see if the class is not yet fully instantiated prior to asttempting to call mono_object_new on it.

* Also cleaning up a minor leak of a MonoError in mono_unity_class_inflate_generic_class
上级 1ffd4e7b
...@@ -287,7 +287,10 @@ MonoClass* mono_unity_class_get_generic_definition(MonoClass* klass) ...@@ -287,7 +287,10 @@ MonoClass* mono_unity_class_get_generic_definition(MonoClass* klass)
MonoClass* mono_unity_class_inflate_generic_class(MonoClass *gklass, MonoGenericContext *context) MonoClass* mono_unity_class_inflate_generic_class(MonoClass *gklass, MonoGenericContext *context)
{ {
MonoError error; MonoError error;
return mono_class_inflate_generic_class_checked(gklass, context, &error); MonoClass* klass;
klass = mono_class_inflate_generic_class_checked(gklass, context, &error);
mono_error_cleanup (&error);
return klass;
} }
gboolean mono_unity_class_has_parent_unsafe(MonoClass *klass, MonoClass *parent) gboolean mono_unity_class_has_parent_unsafe(MonoClass *klass, MonoClass *parent)
...@@ -1898,4 +1901,10 @@ MONO_API uint32_t ...@@ -1898,4 +1901,10 @@ MONO_API uint32_t
mono_unity_allocation_granularity() mono_unity_allocation_granularity()
{ {
return (uint32_t)(2 * sizeof(void *)); return (uint32_t)(2 * sizeof(void *));
} }
\ No newline at end of file
MONO_API gboolean
mono_unity_class_is_open_constructed_type (MonoClass *klass)
{
return mono_class_is_open_constructed_type (&klass->byval_arg);
}
...@@ -202,4 +202,6 @@ mono_unity_set_enable_handler_block_guards (mono_bool allow); ...@@ -202,4 +202,6 @@ mono_unity_set_enable_handler_block_guards (mono_bool allow);
mono_bool mono_bool
mono_unity_get_enable_handler_block_guards (void); mono_unity_get_enable_handler_block_guards (void);
MONO_API gboolean mono_unity_class_is_open_constructed_type (MonoClass *klass);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册