X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fboehm-gc.c;h=b7a5c79e5d9be9d7151a5d9fd724a6b18886cfc7;hb=83f95595b9d8c6c2812a35837aa11312a54278e4;hp=0defba28ec3168a287b7855f6b2a85008d379cba;hpb=0880d632f919feab995ecfdff6b810abfeb0793d;p=mono.git diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c index 0defba28ec3..b7a5c79e5d9 100644 --- a/mono/metadata/boehm-gc.c +++ b/mono/metadata/boehm-gc.c @@ -208,7 +208,9 @@ mono_gc_collect (int generation) { MONO_GC_BEGIN (generation); +#ifndef DISABLE_PERFCOUNTERS mono_perfcounters->gc_induced++; +#endif GC_gcollect (); MONO_GC_END (generation); @@ -410,11 +412,14 @@ on_gc_notification (GCEventType event) mono_thread_info_suspend_unlock (); if (e == MONO_GC_EVENT_START) { +#ifndef DISABLE_PERFCOUNTERS if (mono_perfcounters) mono_perfcounters->gc_collections0++; +#endif gc_stats.major_gc_count ++; gc_start_time = mono_100ns_ticks (); } else if (e == MONO_GC_EVENT_END) { +#ifndef DISABLE_PERFCOUNTERS if (mono_perfcounters) { guint64 heap_size = GC_get_heap_size (); guint64 used_size = heap_size - GC_get_free_bytes (); @@ -423,6 +428,7 @@ on_gc_notification (GCEventType event) mono_perfcounters->gc_reserved_bytes = heap_size; mono_perfcounters->gc_gen0size = heap_size; } +#endif 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); } @@ -433,11 +439,13 @@ static void on_gc_heap_resize (size_t new_size) { guint64 heap_size = GC_get_heap_size (); +#ifndef DISABLE_PERFCOUNTERS if (mono_perfcounters) { mono_perfcounters->gc_committed_bytes = heap_size; mono_perfcounters->gc_reserved_bytes = heap_size; mono_perfcounters->gc_gen0size = heap_size; } +#endif mono_profiler_gc_heap_resize (new_size); }