[Mono-bugs] [Bug 580185] assembly version redirection fails to work properly

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 25 17:08:28 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=580185

http://bugzilla.novell.com/show_bug.cgi?id=580185#c11


--- Comment #11 from Rodrigo Kumpera <rkumpera at novell.com> 2010-02-25 22:08:28 UTC ---
Few points:

+static inline gboolean
+info_versions_equal (MonoAssemblyBindingInfo *left, MonoAssemblyBindingInfo
*right)
+{
..
+
+    if (left->has_new_version && !info_compare_versions (&left->new_version,
&right->new_version))
+        return FALSE;

Shouldn't it check for right->has_new_version as well?

+static void
+assembly_binding_info_parsed (MonoAssemblyBindingInfo *info, void *user_data)

+    mono_loader_lock ();
+    bindings = (MonoPerDomainAssemblyBindings*)g_hash_table_lookup
(domain_assembly_bindings, &domain->domain_id);
+    if (!bindings) {
+        mono_loader_unlock ();
+        return; /* should never happen */
+    }

Pass the bindings hashtable as the user_data param.


+    if (!bindings) {
+        mono_loader_unlock ();
+        return; /* should never happen */
+    }

If it really should never happen, either g_warning or g_error it.


+static inline MonoAssemblyBindingInfo*
+get_per_domain_assembly_binding_info (MonoDomain *domain, MonoAssemblyName
*aname, MonoPerDomainAssemblyBindings 

No need to put inline on all functions. The compiler can do it's just very
well. And for functions complex such as get_per_domain_assembly_binding_info
having proper tracebacks is more important the small perf gain.



MonoDomain is a heavy weight object so there is no need to use an external
hashtable to store the binding information, just put all data there. Besides
that, all memory (linked list and entry) should be allocated using the domain
mempool. 

Just add a g_slist_append_mempool in domain-internals.h:

static GSList*
g_slist_append_mempool (

static inline GSList*
g_slist_append_domain (MonoDomain *domain, GSList *list, gpointer data)
{
GSList *result;
mono_domain_lock (domain);
result = g_slist_append_mempool (domain->mp);
mono_domain_unlock (domain);
return result;
}

You can add a g_new0_domain macro there if you wish.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list