StaticDataFreeList *freelist;
} StaticDataInfo;
-/* Number of cached culture objects in the MonoThread->cached_culture_info array
- * (per-type): we use the first NUM entries for CultureInfo and the last for
- * UICultureInfo. So the size of the array is really NUM_CACHED_CULTURES * 2.
- */
-#define NUM_CACHED_CULTURES 4
-#define CULTURES_START_IDX 0
-#define UICULTURES_START_IDX NUM_CACHED_CULTURES
-
/* Controls access to the 'threads' hash table */
static void mono_threads_lock (void);
static void mono_threads_unlock (void);
thread->abort_exc = NULL;
thread->current_appcontext = NULL;
- /*
- * This is necessary because otherwise we might have
- * cross-domain references which will not get cleaned up when
- * the target domain is unloaded.
- */
- if (thread->cached_culture_info) {
- int i;
- for (i = 0; i < NUM_CACHED_CULTURES * 2; ++i)
- mono_array_set (thread->cached_culture_info, MonoObject*, i, NULL);
- }
-
/*
* thread->synch_cs can be NULL if this was called after
* ves_icall_System_Threading_InternalThread_Thread_free_internal.
if (thread == mono_thread_internal_current ())
mono_thread_pop_appdomain_ref ();
- thread->cached_culture_info = NULL;
-
mono_free_static_data (thread->static_data);
thread->static_data = NULL;
ref_stack_destroy (thread->appdomain_refs);
return TRUE;
}
-static void
-clear_cached_culture (gpointer key, gpointer value, gpointer user_data)
-{
- MonoInternalThread *thread = (MonoInternalThread*)value;
- MonoDomain *domain = (MonoDomain*)user_data;
- int i;
-
- /* No locking needed here */
- /* FIXME: why no locking? writes to the cache are protected with synch_cs above */
-
- if (thread->cached_culture_info) {
- for (i = 0; i < NUM_CACHED_CULTURES * 2; ++i) {
- MonoObject *obj = mono_array_get (thread->cached_culture_info, MonoObject*, i);
- if (obj && obj->vtable->domain == domain)
- mono_array_set (thread->cached_culture_info, MonoObject*, i, NULL);
- }
- }
-}
-
-/*
- * mono_threads_clear_cached_culture:
- *
- * Clear the cached_current_culture from all threads if it is in the
- * given appdomain.
- */
-void
-mono_threads_clear_cached_culture (MonoDomain *domain)
-{
- mono_threads_lock ();
- mono_g_hash_table_foreach (threads, clear_cached_culture, domain);
- mono_threads_unlock ();
-}
-
/*
* mono_thread_get_undeniable_exception:
*
offset == G_STRUCT_OFFSET (MonoRealProxy, unwrapped_server))
return TRUE;
#endif
- /* Thread.cached_culture_info */
- if (!strcmp (ref->vtable->klass->name_space, "System.Globalization") &&
- !strcmp (ref->vtable->klass->name, "CultureInfo") &&
- !strcmp(o->vtable->klass->name_space, "System") &&
- !strcmp(o->vtable->klass->name, "Object[]"))
- return TRUE;
/*
* at System.IO.MemoryStream.InternalConstructor (byte[],int,int,bool,bool) [0x0004d] in /home/schani/Work/novell/trunk/mcs/class/corlib/System.IO/MemoryStream.cs:121
* at System.IO.MemoryStream..ctor (byte[]) [0x00017] in /home/schani/Work/novell/trunk/mcs/class/corlib/System.IO/MemoryStream.cs:81