typedef union {
struct {
+#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+ guint32 type : 1;
+ guint32 offset : 25;
+ guint32 index : 6;
+#else
guint32 index : 6;
guint32 offset : 25;
guint32 type : 1;
+#endif
} fields;
guint32 raw;
} SpecialStaticOffset;
destroy_tls (domain, domain->tlsrec_list->tls_offset);
}
-static MonoClassField *thread_local_slots = NULL;
-static MonoClassField *context_local_slots = NULL;
-
typedef struct {
/* local tls data to get locals_slot from a thread */
guint32 offset;
mono_array_set (slots_array, MonoObject *, sid->slot, NULL);
}
-void
-mono_thread_free_local_slot_values (int slot, MonoBoolean thread_local)
-{
- if (!thread_local_slots) {
- thread_local_slots = mono_class_get_field_from_name (mono_defaults.thread_class, "local_slots");
- if (!thread_local_slots) {
- g_warning ("local_slots field not found in Thread class");
- return;
- }
- }
-
- if (!context_local_slots) {
- MonoClass *ctx_class = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
- context_local_slots = mono_class_get_field_from_name (ctx_class, "local_slots");
- if (!context_local_slots) {
- g_warning ("local_slots field not found in Context class");
- return;
- }
- }
-
- void *addr = NULL;
- MonoDomain *domain = mono_domain_get ();
-
- mono_domain_lock (domain);
-
- if (domain->special_static_fields)
- addr = g_hash_table_lookup (domain->special_static_fields, thread_local ? thread_local_slots : context_local_slots);
-
- mono_domain_unlock (domain);
-
- if (!addr)
- return;
-
- LocalSlotID sid = { .slot = slot, .offset = GPOINTER_TO_UINT (addr) };
-
- mono_threads_lock ();
-
- if (thread_local) {
- mono_g_hash_table_foreach (threads, clear_thread_local_slot, &sid);
- } else {
- g_hash_table_foreach (contexts, clear_context_local_slot, &sid);
- }
-
- mono_threads_unlock ();
-}
-
#ifdef HOST_WIN32
static void CALLBACK dummy_apc (ULONG_PTR param)
{