mono_mb_emit_exception_marshal_directive (mb, msg);
return conv_arg;
}
- if (!spec) {
- char *msg = g_strdup ("[MarshalAs] attribute required to marshal arrays to managed code.");
- mono_mb_emit_exception_marshal_directive (mb, msg);
- return conv_arg;
- }
if (spec->native != MONO_NATIVE_LPARRAY) {
char *msg = g_strdup ("Non LPArray marshalling of arrays to managed code is not implemented.");
mono_mb_emit_exception_marshal_directive (mb, msg);
int index_var, dest_ptr, loc, esize, param_num, num_elem;
MonoMarshalConv conv;
gboolean is_string = FALSE;
-
- if (!spec)
- /* Already handled in CONV_IN */
- break;
/* These are already checked in CONV_IN */
g_assert (!t->byref);
layout = klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
- info = g_malloc0 (sizeof (MonoMarshalType) + sizeof (MonoMarshalField) * count);
+ klass->marshal_info = info = g_malloc0 (sizeof (MonoMarshalType) + sizeof (MonoMarshalField) * count);
info->num_fields = count;
/* Try to find a size for this type in metadata */
if (info->native_size != mono_class_value_size (klass, NULL))
klass->blittable = FALSE;
- mono_loader_lock ();
- if (klass->marshal_info)
- /* Another thread already initialized it */
- g_free (info);
- else
- klass->marshal_info = info;
- mono_loader_unlock ();
-
/* If this is an array type, ensure that we have element info */
if (klass->element_class) {
mono_marshal_load_type_info (klass->element_class);
/* Need to register the icall so it gets an icall wrapper */
sprintf (icall_name, "ves_array_new_va_%d", rank);
- mono_jit_lock ();
info = mono_find_jit_icall_by_name (icall_name);
if (info == NULL) {
esig = mono_get_array_new_va_signature (rank);
name = g_strdup (icall_name);
info = mono_register_jit_icall (mono_array_new_va, name, esig, FALSE);
+ mono_jit_lock ();
g_hash_table_insert (jit_icall_name_hash, name, name);
+ mono_jit_unlock ();
}
- mono_jit_unlock ();
cfg->flags |= MONO_CFG_HAS_VARARGS;
/* Need to register the icall so it gets an icall wrapper */
sprintf (icall_name, "ves_array_element_address_%d", rank);
- mono_jit_lock ();
info = mono_find_jit_icall_by_name (icall_name);
if (info == NULL) {
esig = mono_get_element_address_signature (rank);
name = g_strdup (icall_name);
info = mono_register_jit_icall (ves_array_element_address, name, esig, FALSE);
+ mono_jit_lock ();
g_hash_table_insert (jit_icall_name_hash, name, name);
+ mono_jit_unlock ();
}
- mono_jit_unlock ();
/* FIXME: This uses info->sig, but it should use the signature of the wrapper */
temp = mono_emit_native_call (cfg, bblock, mono_icall_get_wrapper (info), info->sig, sp, ip, FALSE, FALSE);
#endif
g_assert (sigaction (signo, &sa, NULL) != -1);
}
-
-static void
-remove_signal_handler (int signo)
-{
- struct sigaction sa;
-
- sa.sa_handler = SIG_DFL;
- sigemptyset (&sa.sa_mask);
- sa.sa_flags = 0;
-
- g_assert (sigaction (signo, &sa, NULL) != -1);
-}
#endif
static void
#else /* !PLATFORM_WIN32 */
+ /* libpthreads has its own implementation of sigaction(),
+ * but it seems to work well with our current exception
+ * handlers. If not we must call syscall directly instead
+ * of sigaction */
+
if (debug_options.handle_sigint)
add_signal_handler (SIGINT, sigint_signal_handler);
#endif /* PLATFORM_WIN32 */
}
-static void
-mono_runtime_cleanup_handlers (void)
-{
-#ifdef PLATFORM_WIN32
- win32_seh_cleanup();
-#else
- if (debug_options.handle_sigint)
- remove_signal_handler (SIGINT);
-
- remove_signal_handler (SIGFPE);
- remove_signal_handler (SIGQUIT);
- remove_signal_handler (SIGILL);
- remove_signal_handler (SIGBUS);
- if (mono_jit_trace_calls != NULL)
- remove_signal_handler (SIGUSR2);
-
- remove_signal_handler (mono_thread_get_abort_signal ());
-
- remove_signal_handler (SIGABRT);
-
- remove_signal_handler (SIGSEGV);
-#endif /* PLATFORM_WIN32 */
-}
-
#ifdef HAVE_LINUX_RTC_H
#include <linux/rtc.h>
mono_icall_cleanup ();
- mono_runtime_cleanup_handlers ();
+#ifdef PLATFORM_WIN32
+ win32_seh_cleanup();
+#endif
mono_domain_free (domain, TRUE);