void mono_sgen_los_iterate_objects (IterateObjectCallbackFunc cb, void *user_data) MONO_INTERNAL;
void mono_sgen_los_iterate_live_block_ranges (sgen_cardtable_block_callback callback) MONO_INTERNAL;
void mono_sgen_los_scan_card_table (SgenGrayQueue *queue) MONO_INTERNAL;
+=======
+void sgen_collect_major_no_lock (const char *reason) MONO_INTERNAL;;
+FILE *mono_sgen_get_logfile (void) MONO_INTERNAL;
+>>>>>>> Share the log file between sgen and the stack marking code.
#endif /* __MONO_SGENGC_H__ */
//#if 0
#ifdef HAVE_SGEN_GC
+#include <mono/metadata/sgen-gc.h>
#include <mono/metadata/gc-internal.h>
#include <mono/utils/mono-counters.h>
#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
-#if 0
+#if 1
+/* We don't support debug levels, its all-or-nothing */
#define DEBUG(s) do { s; fflush (logfile); } while (0)
#define DEBUG_ENABLED 1
#else
#define DEBUG_GC_MAP(s)
#endif
-#define GC_BITS_PER_WORD (sizeof (gsize) * 8)
-
/*
* Contains information collected during the conservative stack marking pass,
* used during the precise pass. This helps to avoid doing a stack walk twice, which
opts = g_strsplit (env, ",", -1);
for (ptr = opts; ptr && *ptr; ptr ++) {
- char *opt = *ptr;
-
- if (g_str_has_prefix (opt, "logfile=")) {
- char *arg = strchr (opt, '=') + 1;
- logfile = fopen (arg, "w");
- g_assert (logfile);
- } else {
- fprintf (stderr, "Invalid format for the MONO_GCMAP_DEBUG env variable: '%s'\n", env);
- exit (1);
- }
+ /* No options yet */
+ fprintf (stderr, "Invalid format for the MONO_GCMAP_DEBUG env variable: '%s'\n", env);
+ exit (1);
}
g_strfreev (opts);
}
cb.thread_mark_func = thread_mark_func;
mono_gc_set_gc_callbacks (&cb);
- logfile = stdout;
+ logfile = mono_sgen_get_logfile ();
+
parse_debug_options ();
mono_counters_register ("GC Maps size",
mono_icall_init ();
+ /* This should come after mono_init () too */
+ mini_gc_init ();
+
mono_add_internal_call ("System.Diagnostics.StackFrame::get_frame_info",
ves_icall_get_frame_info);
mono_add_internal_call ("System.Diagnostics.StackTrace::get_trace",