Merge pull request #439 from mono-soc-2012/garyb/iconfix
[mono.git] / mono / metadata / boehm-gc.c
index d7387ec7ba1e51531f85c4a2858865828ec111b2..132dd7d25b970b71540091079427765f19cfff08 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
  * Copyright 2004-2011 Novell, Inc (http://www.novell.com)
- * Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
+ * Copyright 2011-2012 Xamarin, Inc (http://www.xamarin.com)
  */
 
 #include "config.h"
 #include "private/pthread_support.h"
 #endif
 
+#if defined(PLATFORM_MACOSX) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
+void *pthread_get_stackaddr_np(pthread_t);
+#endif
+
 #define GC_NO_DESCRIPTOR ((gpointer)(0 | GC_DS_LENGTH))
 /*Boehm max heap cannot be smaller than 16MB*/
 #define MIN_BOEHM_MAX_HEAP_SIZE_IN_MB 16
@@ -163,9 +167,12 @@ mono_gc_base_init (void)
                                }
                                continue;
                        } else {
+                               /* Could be a parameter for sgen */
+                               /*
                                fprintf (stderr, "MONO_GC_PARAMS must be a comma-delimited list of one or more of the following:\n");
                                fprintf (stderr, "  max-heap-size=N (where N is an integer, possibly with a k, m or a g suffix)\n");
                                exit (1);
+                               */
                        }
                }
                g_strfreev (opts);
@@ -405,7 +412,7 @@ on_gc_notification (GCEventType event)
        if (e == MONO_GC_EVENT_START) {
                if (mono_perfcounters)
                        mono_perfcounters->gc_collections0++;
-               mono_stats.major_gc_count ++;
+               gc_stats.major_gc_count ++;
                gc_start_time = mono_100ns_ticks ();
        } else if (e == MONO_GC_EVENT_END) {
                if (mono_perfcounters) {
@@ -416,7 +423,7 @@ on_gc_notification (GCEventType event)
                        mono_perfcounters->gc_reserved_bytes = heap_size;
                        mono_perfcounters->gc_gen0size = heap_size;
                }
-               mono_stats.major_gc_time_usecs += (mono_100ns_ticks () - gc_start_time) / 10;
+               gc_stats.major_gc_time_usecs += (mono_100ns_ticks () - gc_start_time) / 10;
                mono_trace_message (MONO_TRACE_GC, "gc took %d usecs", (mono_100ns_ticks () - gc_start_time) / 10);
        }
        mono_profiler_gc_event (e, 0);
@@ -1217,6 +1224,15 @@ mono_gc_set_gc_callbacks (MonoGCCallbacks *callbacks)
 {
 }
 
+void
+mono_gc_set_stack_end (void *stack_end)
+{
+}
+
+void mono_gc_set_skip_thread (gboolean value)
+{
+}
+
 /*
  * These will call the redefined versions in libgc.
  */
@@ -1260,4 +1276,43 @@ BOOL APIENTRY mono_gc_dllmain (HMODULE module_handle, DWORD reason, LPVOID reser
 }
 #endif
 
+guint
+mono_gc_get_vtable_bits (MonoClass *class)
+{
+       return 0;
+}
+
+/*
+ * mono_gc_register_altstack:
+ *
+ *   Register the dimensions of the normal stack and altstack with the collector.
+ * Currently, STACK/STACK_SIZE is only used when the thread is suspended while it is on an altstack.
+ */
+void
+mono_gc_register_altstack (gpointer stack, gint32 stack_size, gpointer altstack, gint32 altstack_size)
+{
+#ifdef USE_INCLUDED_LIBGC
+       GC_register_altstack (stack, stack_size, altstack, altstack_size);
+#endif
+}
+
+int
+mono_gc_get_los_limit (void)
+{
+       return G_MAXINT;
+}
+
+gboolean
+mono_gc_user_markers_supported (void)
+{
+       return FALSE;
+}
+
+void *
+mono_gc_make_root_descr_user (MonoGCRootMarkFunc marker)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
 #endif /* no Boehm GC */