}
}
-
+/**
+ * mono_custom_attrs_free:
+ */
void
mono_custom_attrs_free (MonoCustomAttrInfo *ainfo)
{
g_free (ainfo);
}
-
gboolean
reflected_equal (gconstpointer a, gconstpointer b)
{
return seed;
}
-
static void
clear_cached_object (MonoDomain *domain, gpointer o, MonoClass *klass)
{
pe.item = o;
pe.refclass = klass;
- if (mono_g_hash_table_lookup_extended (domain->refobject_hash, &pe, &orig_pe, &orig_value)) {
- mono_g_hash_table_remove (domain->refobject_hash, &pe);
- FREE_REFENTRY (orig_pe);
+
+ if (mono_conc_g_hash_table_lookup_extended (domain->refobject_hash, &pe, &orig_pe, &orig_value)) {
+ mono_conc_g_hash_table_remove (domain->refobject_hash, &pe);
+ free_reflected_entry (orig_pe);
}
}
mono_domain_unlock (domain);
}
-#ifdef REFENTRY_REQUIRES_CLEANUP
static void
cleanup_refobject_hash (gpointer key, gpointer value, gpointer user_data)
{
- FREE_REFENTRY (key);
+ free_reflected_entry (key);
}
-#endif
void
mono_reflection_cleanup_domain (MonoDomain *domain)
{
if (domain->refobject_hash) {
-/*let's avoid scanning the whole hashtable if not needed*/
-#ifdef REFENTRY_REQUIRES_CLEANUP
- mono_g_hash_table_foreach (domain->refobject_hash, cleanup_refobject_hash, NULL);
-#endif
- mono_g_hash_table_destroy (domain->refobject_hash);
+ mono_conc_g_hash_table_foreach (domain->refobject_hash, cleanup_refobject_hash, NULL);
+ mono_conc_g_hash_table_destroy (domain->refobject_hash);
domain->refobject_hash = NULL;
}
}
-
/**
* mono_assembly_get_object:
* \param domain an app domain
return type;
}
-/*
+
+/**
* mono_type_get_object:
- * @domain: an app domain
- * @type: a type
- *
- * Return an System.MonoType object representing the type @type.
+ * \param domain an app domain
+ * \param type a type
+ * \returns A \c System.MonoType object representing the type \p type.
*/
MonoReflectionType*
mono_type_get_object (MonoDomain *domain, MonoType *type)
}
}
-/*
+/**
* mono_field_get_object:
- * @domain: an app domain
- * @klass: a type
- * @field: a field
- *
- * Return an System.Reflection.MonoField object representing the field @field
- * in class @klass.
+ * \param domain an app domain
+ * \param klass a type
+ * \param field a field
+ * \returns A \c System.Reflection.MonoField object representing the field \p field
+ * in class \p klass.
*/
MonoReflectionField*
mono_field_get_object (MonoDomain *domain, MonoClass *klass, MonoClassField *field)
HANDLE_FUNCTION_RETURN_OBJ (res);
}
-/*
+/**
* mono_event_get_object:
- * @domain: an app domain
- * @klass: a type
- * @event: a event
- *
- * Return an System.Reflection.MonoEvent object representing the event @event
- * in class @klass.
+ * \param domain an app domain
+ * \param klass a type
+ * \param event a event
+ * \returns A \c System.Reflection.MonoEvent object representing the event \p event
+ * in class \p klass.
*/
MonoReflectionEvent*
mono_event_get_object (MonoDomain *domain, MonoClass *klass, MonoEvent *event)
HANDLE_FUNCTION_RETURN_OBJ (result);
}
+/* WARNING: This method can return NULL on sucess */
static MonoReflectionMethodBodyHandle
method_body_object_construct (MonoDomain *domain, MonoClass *unused_class, MonoMethod *method, gpointer user_data, MonoError *error)
{
g_list_foreach(info->nested, &unescape_each_nested_name, NULL);
}
+/**
+ * mono_reflection_parse_type:
+ */
int
mono_reflection_parse_type (char *name, MonoTypeNameParse *info)
{
static MonoType*
mono_reflection_get_type_internal (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, MonoError *error)
{
+ HANDLE_FUNCTION_ENTER ();
MonoClass *klass;
GList *mod;
int modval;
gboolean bounded = FALSE;
+ MonoType* type = NULL;
error_init (error);
if (!image)
klass = mono_class_from_name_checked (image, info->name_space, info->name, error);
if (!klass)
- return NULL;
+ goto leave;
for (mod = info->nested; mod; mod = mod->next) {
gpointer iter = NULL;
break;
}
if (!klass)
- return NULL;
+ goto leave;
if (info->type_arguments) {
MonoType **type_args = g_new0 (MonoType *, info->type_arguments->len);
type_args [i] = _mono_reflection_get_type_from_info (subinfo, rootimage, ignorecase, error);
if (!type_args [i]) {
g_free (type_args);
- return NULL;
+ goto leave;
}
}
the_type = mono_type_get_object_handle (mono_domain_get (), &klass->byval_arg, error);
if (!is_ok (error) || MONO_HANDLE_IS_NULL (the_type))
- return NULL;
+ goto leave;
instance = mono_reflection_bind_generic_parameters (
the_type, info->type_arguments->len, type_args, error);
g_free (type_args);
if (!instance)
- return NULL;
+ goto leave;
klass = mono_class_from_mono_type (instance);
}
for (mod = info->modifiers; mod; mod = mod->next) {
modval = GPOINTER_TO_UINT (mod->data);
if (!modval) { /* byref: must be last modifier */
- return &klass->this_arg;
+ type = &klass->this_arg;
+ goto leave;
} else if (modval == -1) {
klass = mono_ptr_class_get (&klass->byval_arg);
} else if (modval == -2) {
}
}
- return &klass->byval_arg;
+ type = &klass->byval_arg;
+
+leave:
+ HANDLE_FUNCTION_RETURN_VAL (type);
}
-/*
+/**
* mono_reflection_get_type:
- * @image: a metadata context
- * @info: type description structure
- * @ignorecase: flag for case-insensitive string compares
- * @type_resolve: whenever type resolve was already tried
+ * \param image a metadata context
+ * \param info type description structure
+ * \param ignorecase flag for case-insensitive string compares
+ * \param type_resolve whenever type resolve was already tried
*
- * Build a MonoType from the type description in @info.
+ * Build a MonoType from the type description in \p info.
*
*/
-
MonoType*
mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve) {
MonoError error;
return type;
}
+/**
+ * mono_reflection_free_type_info:
+ */
void
mono_reflection_free_type_info (MonoTypeNameParse *info)
{
}
}
-/*
+/**
* mono_reflection_type_from_name:
- * @name: type name.
- * @image: a metadata context (can be NULL).
+ * \param name type name.
+ * \param image a metadata context (can be NULL).
*
- * Retrieves a MonoType from its @name. If the name is not fully qualified,
- * it defaults to get the type from @image or, if @image is NULL or loading
+ * Retrieves a \c MonoType from its \p name. If the name is not fully qualified,
+ * it defaults to get the type from \p image or, if \p image is NULL or loading
* from it fails, uses corlib.
*
*/
return type;
}
-/*
+/**
* mono_reflection_get_token:
- *
- * Return the metadata token of OBJ which should be an object
+ * \returns the metadata token of \p obj which should be an object
* representing a metadata element.
*/
guint32
MonoReflectionTypeBuilderHandle tb = MONO_HANDLE_CAST (MonoReflectionTypeBuilder, obj);
token = MONO_HANDLE_GETVAL (tb, table_idx) | MONO_TOKEN_TYPE_DEF;
} else if (strcmp (klass->name, "RuntimeType") == 0) {
- MonoType *type = mono_reflection_type_get_handle (MONO_HANDLE_RAW (MONO_HANDLE_CAST (MonoReflectionType, obj)), error); /* FIXME use handles */
+ MonoType *type = mono_reflection_type_handle_mono_type (MONO_HANDLE_CAST (MonoReflectionType, obj), error);
return_val_if_nok (error, 0);
MonoClass *mc = mono_class_from_mono_type (type);
if (!mono_class_init (mc)) {
return result;
}
-/*
+/**
+ * mono_declsec_flags_from_method:
+ * \param method The method for which we want the declarative security flags.
* Get the security actions (in the form of flags) associated with the specified method.
- *
- * @method: The method for which we want the declarative security flags.
- * Return the declarative security flags for the method (only).
- *
- * Note: To keep MonoMethod size down we do not cache the declarative security flags
- * (except for the stack modifiers which are kept in the MonoJitInfo structure)
+ * To keep \c MonoMethod size down we do not cache the declarative security flags
+ * (except for the stack modifiers which are kept in the MonoJitInfo structure)
+ * \returns the declarative security flags for the method (only).
*/
guint32
mono_declsec_flags_from_method (MonoMethod *method)
return 0;
}
-/*
+/**
+ * mono_declsec_flags_from_class:
+ * \param klass The class for which we want the declarative security flags.
* Get the security actions (in the form of flags) associated with the specified class.
- *
- * @klass: The class for which we want the declarative security flags.
- * Return the declarative security flags for the class.
- *
- * Note: We cache the flags inside the MonoClass structure as this will get
- * called very often (at least for each method).
+ * We cache the flags inside the \c MonoClass structure as this will get
+ * called very often (at least for each method).
+ * \returns the declarative security flags for the class.
*/
guint32
mono_declsec_flags_from_class (MonoClass *klass)
return 0;
}
-/*
+/**
+ * mono_declsec_flags_from_assembly:
+ * \param assembly The assembly for which we want the declarative security flags.
* Get the security actions (in the form of flags) associated with the specified assembly.
- *
- * @assembly: The assembly for which we want the declarative security flags.
- * Return the declarative security flags for the assembly.
+ * \returns the declarative security flags for the assembly.
*/
guint32
mono_declsec_flags_from_assembly (MonoAssembly *assembly)
return fill_actions_from_index (method->klass->image, idx, demands, id_std, id_noncas, id_choice);
}
-/*
+/**
+ * mono_declsec_get_demands:
* Collect all actions (that requires to generate code in mini) assigned for
* the specified method.
- * Note: Don't use the content of actions if the function return FALSE.
+ * Don't use the content of actions if the function return FALSE.
*/
MonoBoolean
mono_declsec_get_demands (MonoMethod *method, MonoDeclSecurityActions* demands)
}
-/*
- * Collect all Link actions: LinkDemand, NonCasLinkDemand and LinkDemandChoice (2.0).
- *
- * Note: Don't use the content of actions if the function return FALSE.
+/**
+ * mono_declsec_get_linkdemands:
+ * Collect all Link actions: \c LinkDemand, \c NonCasLinkDemand and \c LinkDemandChoice (2.0).
+ * Don't use the content of actions if the function return FALSE.
*/
MonoBoolean
mono_declsec_get_linkdemands (MonoMethod *method, MonoDeclSecurityActions* klass, MonoDeclSecurityActions *cmethod)
return result;
}
-/*
- * Collect all Inherit actions: InheritanceDemand, NonCasInheritanceDemand and InheritanceDemandChoice (2.0).
- *
- * @klass The inherited class - this is the class that provides the security check (attributes)
- * @demans
- * return TRUE if inheritance demands (any kind) are present, FALSE otherwise.
- *
- * Note: Don't use the content of actions if the function return FALSE.
+/**
+ * mono_declsec_get_inheritdemands_class:
+ * \param klass The inherited class - this is the class that provides the security check (attributes)
+ * \param demands
+ * Collect all Inherit actions - \c InheritanceDemand, \c NonCasInheritanceDemand and \c InheritanceDemandChoice (2.0).
+ * Don't use the content of actions if the function return FALSE.
+ * \returns TRUE if inheritance demands (any kind) are present, FALSE otherwise.
*/
MonoBoolean
mono_declsec_get_inheritdemands_class (MonoClass *klass, MonoDeclSecurityActions* demands)
return result;
}
-/*
- * Collect all Inherit actions: InheritanceDemand, NonCasInheritanceDemand and InheritanceDemandChoice (2.0).
- *
- * Note: Don't use the content of actions if the function return FALSE.
+/**
+ * mono_declsec_get_inheritdemands_method:
+ * Collect all Inherit actions: \c InheritanceDemand, \c NonCasInheritanceDemand and \c InheritanceDemandChoice (2.0).
+ * Don't use the content of actions if the function return FALSE.
*/
MonoBoolean
mono_declsec_get_inheritdemands_method (MonoMethod *method, MonoDeclSecurityActions* demands)
return FALSE;
}
+/**
+ * mono_declsec_get_class_action:
+ */
MonoBoolean
mono_declsec_get_class_action (MonoClass *klass, guint32 action, MonoDeclSecurityEntry *entry)
{
return FALSE;
}
+/**
+ * mono_declsec_get_assembly_action:
+ */
MonoBoolean
mono_declsec_get_assembly_action (MonoAssembly *assembly, guint32 action, MonoDeclSecurityEntry *entry)
{