char *end_addr = generation == GENERATION_NURSERY ? sgen_get_nursery_end () : (char*)-1;
SgenGrayQueue *queue = ctx.queue;
+ binary_protocol_finish_gray_stack_start (sgen_timestamp (), generation);
/*
* We copied all the reachable objects. Now it's the time to copy
* the objects that were not referenced by the roots, but by the copied objects.
g_assert (sgen_gray_object_queue_is_empty (queue));
sgen_gray_object_queue_trim_free_list (queue);
+ binary_protocol_finish_gray_stack_end (sgen_timestamp (), generation);
}
void
SGEN_LOG (2, "Finding pinned pointers: %zd in %ld usecs", sgen_get_pinned_count (), TV_ELAPSED (btv, atv));
SGEN_LOG (4, "Start scan with %zd pinned objects", sgen_get_pinned_count ());
- /*
- * FIXME: When we finish a concurrent collection we do a nursery collection first,
- * as part of which we scan the card table. Then, later, we scan the mod union
- * cardtable. We should only have to do one.
- */
sj = (ScanJob*)sgen_thread_pool_job_alloc ("scan remset", job_remembered_set_scan, sizeof (ScanJob));
sj->ops = object_ops;
sgen_workers_enqueue_job (&sj->job, FALSE);
time_major_fragment_creation += TV_ELAPSED (atv, btv);
binary_protocol_sweep_begin (GENERATION_OLD, !major_collector.sweeps_lazily);
+ sgen_memgov_major_pre_sweep ();
TV_GETTIME (atv);
time_major_free_bigobjs += TV_ELAPSED (btv, atv);
* LOCKING: The GC lock MUST be held.
*/
void
-sgen_ensure_free_space (size_t size)
+sgen_ensure_free_space (size_t size, int generation)
{
int generation_to_collect = -1;
const char *reason = NULL;
- if (size > SGEN_MAX_SMALL_OBJ_SIZE) {
+ if (generation == GENERATION_OLD) {
if (sgen_need_major_collection (size)) {
reason = "LOS overflow";
generation_to_collect = GENERATION_OLD;
return;
case -1:
/* being inited by another thread */
- g_usleep (1000);
+ mono_thread_info_usleep (1000);
break;
case 0:
/* we will init it */
SGEN_ASSERT (0, !world_is_stopped, "Why are we stopping a stopped world?");
- binary_protocol_world_stopping (generation, sgen_timestamp (), (gpointer)mono_native_thread_id_get ());
+ binary_protocol_world_stopping (generation, sgen_timestamp (), (gpointer) (gsize) mono_native_thread_id_get ());
sgen_client_stop_world (generation);