[sgen] Split up concurrent sweep from worker logic
[mono.git] / mono / sgen / sgen-memory-governor.c
index dc69381547f60bfb192de3cbec934092f20022c3..3bf90115b854910c743596a6e32c1a061e35d734 100644 (file)
@@ -1,6 +1,6 @@
-/*
- * sgen-memory-governor.c: When to schedule collections based on
- * memory usage.
+/**
+ * \file
+ * When to schedule collections based on memory usage.
  *
  * Author:
  *     Rodrigo Kumpera (rkumpera@novell.com)
@@ -20,7 +20,7 @@
 
 #include "mono/sgen/sgen-gc.h"
 #include "mono/sgen/sgen-memory-governor.h"
-#include "mono/sgen/sgen-thread-pool.h"
+#include "mono/sgen/sgen-workers.h"
 #include "mono/sgen/sgen-client.h"
 
 #define MIN_MINOR_COLLECTION_ALLOWANCE ((mword)(DEFAULT_NURSERY_SIZE * default_allowance_nursery_size_ratio))
@@ -295,7 +295,7 @@ sgen_output_log_entry (SgenLogEntry *entry, gint64 stw_time, int generation)
 
        switch (entry->type) {
                case SGEN_LOG_NURSERY:
-                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MINOR%s: (%s) time %.2fms, %s promoted %dK major size: %dK in use: %dK los size: %dK in use: %dK",
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MINOR%s: (%s) time %.2fms, %s promoted %zdK major size: %zdK in use: %zdK los size: %zdK in use: %zdK",
                                entry->is_overflow ? "_OVERFLOW" : "",
                                entry->reason ? entry->reason : "",
                                entry->time / 10000.0f,
@@ -307,7 +307,7 @@ sgen_output_log_entry (SgenLogEntry *entry, gint64 stw_time, int generation)
                                entry->los_size_in_use / 1024);
                        break;
                case SGEN_LOG_MAJOR_SERIAL:
-                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR%s: (%s) time %.2fms, %s los size: %dK in use: %dK",
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR%s: (%s) time %.2fms, %s los size: %zdK in use: %zdK",
                                entry->is_overflow ? "_OVERFLOW" : "",
                                entry->reason ? entry->reason : "",
                                (int)entry->time / 10000.0f,
@@ -319,7 +319,7 @@ sgen_output_log_entry (SgenLogEntry *entry, gint64 stw_time, int generation)
                        mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_CONCURRENT_START: (%s)", entry->reason ? entry->reason : "");
                        break;
                case SGEN_LOG_MAJOR_CONC_FINISH:
-                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_CONCURRENT_FINISH: (%s) time %.2fms, %s los size: %dK in use: %dK",
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_CONCURRENT_FINISH: (%s) time %.2fms, %s los size: %zdK in use: %zdK",
                                entry->reason ? entry->reason : "",
                                entry->time / 10000.0f,
                                full_timing_buff,
@@ -327,7 +327,7 @@ sgen_output_log_entry (SgenLogEntry *entry, gint64 stw_time, int generation)
                                entry->los_size_in_use / 1024);
                        break;
                case SGEN_LOG_MAJOR_SWEEP_FINISH:
-                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_SWEEP: major size: %dK in use: %dK",
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_SWEEP: major size: %zdK in use: %zdK",
                                entry->major_size / 1024,
                                entry->major_size_in_use / 1024);
                        break;
@@ -459,7 +459,7 @@ gboolean
 sgen_memgov_try_alloc_space (mword size, int space)
 {
        if (sgen_memgov_available_free_space () < size) {
-               SGEN_ASSERT (4, !sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "Memory shouldn't run out in worker thread");
+               SGEN_ASSERT (4, !sgen_workers_is_worker_thread (mono_native_thread_id_get ()), "Memory shouldn't run out in worker thread");
                return FALSE;
        }