[sgen] Move thread info to Mono client code.
[mono.git] / mono / metadata / sgen-client-mono.h
index 26a1d10bf6a16c54b38e1b406f900964864f3805..2b04ceab650f170855e59f7609f13f6cac6311d8 100644 (file)
@@ -310,6 +310,13 @@ sgen_client_binary_protocol_collection_begin (int minor_gc_count, int generation
        MONO_GC_BEGIN (generation);
 
        mono_profiler_gc_event (MONO_GC_EVENT_START, generation);
+
+#ifndef DISABLE_PERFCOUNTERS
+       if (generation == GENERATION_NURSERY)
+               mono_perfcounters->gc_collections0++;
+       else
+               mono_perfcounters->gc_collections1++;
+#endif
 }
 
 static void G_GNUC_UNUSED
@@ -563,9 +570,11 @@ gboolean sgen_resume_thread (SgenThreadInfo *info);
 void sgen_wait_for_suspend_ack (int count);
 
 #ifdef HAVE_KW_THREAD
+extern __thread SgenThreadInfo *sgen_thread_info;
 #define TLAB_ACCESS_INIT
 #define IN_CRITICAL_REGION sgen_thread_info->client_info.in_critical_region
 #else
+extern MonoNativeTlsKey thread_info_key;
 #define TLAB_ACCESS_INIT       SgenThreadInfo *__thread_info__ = mono_native_tls_get_value (thread_info_key)
 #define IN_CRITICAL_REGION (__thread_info__->client_info.in_critical_region)
 #endif