#define safe_object_get_size sgen_safe_object_get_size
-#if defined(PLATFORM_MACOSX) || defined(HOST_WIN32) || (defined(__linux__) && !defined(PLATFORM_ANDROID))
+#if defined(HAVE_CONC_GC_AS_DEFAULT)
/* Use concurrent major on deskstop platforms */
#define DEFAULT_MAJOR_INIT sgen_marksweep_conc_init
#define DEFAULT_MAJOR_NAME "marksweep-conc"
/* Threads */
stdj = (ScanThreadDataJob*)sgen_thread_pool_job_alloc ("scan thread data", job_scan_thread_data, sizeof (ScanThreadDataJob));
+ stdj->ops = ops;
stdj->heap_start = heap_start;
stdj->heap_end = heap_end;
sgen_workers_enqueue_job (&stdj->job, enqueue);
if (generation_to_collect == -1)
return;
- sgen_perform_collection (size, generation_to_collect, reason, FALSE);
+ sgen_perform_collection (size, generation_to_collect, reason, FALSE, TRUE);
}
/*
* LOCKING: Assumes the GC lock is held.
*/
void
-sgen_perform_collection (size_t requested_size, int generation_to_collect, const char *reason, gboolean wait_to_finish)
+sgen_perform_collection (size_t requested_size, int generation_to_collect, const char *reason, gboolean wait_to_finish, gboolean stw)
{
TV_DECLARE (gc_total_start);
TV_DECLARE (gc_total_end);
SGEN_ASSERT (0, generation_to_collect == GENERATION_NURSERY || generation_to_collect == GENERATION_OLD, "What generation is this?");
- sgen_stop_world (generation_to_collect);
+ if (stw)
+ sgen_stop_world (generation_to_collect);
+ else
+ SGEN_ASSERT (0, sgen_is_world_stopped (), "We can only collect if the world is stopped");
+
TV_GETTIME (gc_total_start);
TV_GETTIME (gc_total_end);
time_max = MAX (time_max, TV_ELAPSED (gc_total_start, gc_total_end));
- sgen_restart_world (oldest_generation_collected);
+ if (stw)
+ sgen_restart_world (oldest_generation_collected);
}
/*
LOCK_GC;
if (generation > 1)
generation = 1;
- sgen_perform_collection (0, generation, "user request", TRUE);
+ sgen_perform_collection (0, generation, "user request", TRUE, TRUE);
UNLOCK_GC;
}
double val;
opt = strchr (opt, '=') + 1;
if (parse_double_in_interval (MONO_GC_PARAMS_NAME, "default-allowance-ratio", opt,
- SGEN_MIN_ALLOWANCE_NURSERY_SIZE_RATIO, SGEN_MIN_ALLOWANCE_NURSERY_SIZE_RATIO, &val)) {
+ SGEN_MIN_ALLOWANCE_NURSERY_SIZE_RATIO, SGEN_MAX_ALLOWANCE_NURSERY_SIZE_RATIO, &val)) {
allowance_ratio = val;
}
continue;