NaCl runtime fixes
[mono.git] / mono / metadata / gc.c
index f0a6ef10c95fe8714d6884224cb9c6574eff6d69..5d0584bb810a58e2b86f540571bfe76ef025eb92 100644 (file)
@@ -36,6 +36,7 @@
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/dtrace.h>
 #include <mono/utils/mono-threads.h>
+#include <mono/utils/atomic.h>
 
 #ifndef HOST_WIN32
 #include <pthread.h>
@@ -341,6 +342,10 @@ mono_domain_finalize (MonoDomain *domain, guint32 timeout)
        HANDLE done_event;
        MonoInternalThread *thread = mono_thread_internal_current ();
 
+#if defined(__native_client__)
+       return FALSE;
+#endif
+
        if (mono_thread_internal_current () == gc_thread)
                /* We are called from inside a finalizer, not much we can do here */
                return FALSE;
@@ -1136,6 +1141,7 @@ mono_gc_init (void)
        MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_NORMAL].entries);
        MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_PINNED].entries);
 
+       mono_counters_register ("Created object count", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &mono_stats.new_object_count);
        mono_counters_register ("Minor GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &gc_stats.minor_gc_count);
        mono_counters_register ("Major GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &gc_stats.major_gc_count);
        mono_counters_register ("Minor GC time", MONO_COUNTER_GC | MONO_COUNTER_TIME_INTERVAL, &gc_stats.minor_gc_time_usecs);