class_next_value);
image->field_cache = mono_conc_hashtable_new (NULL, NULL);
- image->typespec_cache = g_hash_table_new (NULL, NULL);
+ image->typespec_cache = mono_conc_hashtable_new (NULL, NULL);
image->memberref_signatures = g_hash_table_new (NULL, NULL);
image->helper_signatures = g_hash_table_new (g_str_hash, g_str_equal);
image->method_signatures = g_hash_table_new (NULL, NULL);
free_hash (image->pinvoke_scopes);
free_hash (image->pinvoke_scope_filenames);
free_hash (image->native_func_wrapper_cache);
- free_hash (image->typespec_cache);
+ mono_conc_hashtable_destroy (image->typespec_cache);
mono_wrapper_caches_free (&image->wrapper_caches);
MonoConcurrentHashTable *field_cache; /*protected by the image lock*/
/* indexed by typespec tokens. */
- GHashTable *typespec_cache; /* protected by the image lock */
+ MonoConcurrentHashTable *typespec_cache; /* protected by the image lock */
/* indexed by token */
GHashTable *memberref_signatures;
GHashTable *helper_signatures;
error_init (error);
- mono_image_lock (image);
- type = (MonoType *)g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec));
- mono_image_unlock (image);
+ type = (MonoType *)mono_conc_hashtable_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec));
if (type)
return type;
mono_metadata_free_type (type);
mono_image_lock (image);
- type = (MonoType *)g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec));
+
/* We might leak some data in the image mempool if found */
- if (!type) {
- g_hash_table_insert (image->typespec_cache, GUINT_TO_POINTER (type_spec), type2);
+ type = mono_conc_hashtable_insert (image->typespec_cache, GUINT_TO_POINTER (type_spec), type2);
+ if (!type)
type = type2;
- }
+
mono_image_unlock (image);
return type;