static LOCK_DECLARE (workers_distribute_gray_queue_mutex);
-void
+gboolean
sgen_remember_major_object_for_concurrent_mark (char *obj)
{
gboolean need_lock = current_collection_generation != GENERATION_NURSERY;
if (!major_collector.is_concurrent)
- return;
+ return FALSE;
g_assert (current_collection_generation == GENERATION_NURSERY || current_collection_generation == -1);
if (!concurrent_collection_in_progress)
- return;
+ return FALSE;
if (need_lock)
mono_mutex_lock (&workers_distribute_gray_queue_mutex);
if (need_lock)
mono_mutex_unlock (&workers_distribute_gray_queue_mutex);
+
+ return TRUE;
}
static gboolean
gboolean sgen_collection_is_concurrent (void) MONO_INTERNAL;
gboolean sgen_concurrent_collection_in_progress (void) MONO_INTERNAL;
-void sgen_remember_major_object_for_concurrent_mark (char *obj) MONO_INTERNAL;
+gboolean sgen_remember_major_object_for_concurrent_mark (char *obj) MONO_INTERNAL;
typedef struct {
CopyOrMarkObjectFunc copy_or_mark_object;
los_consistency_check ();
#endif
- sgen_remember_major_object_for_concurrent_mark (obj->data);
+ if (sgen_remember_major_object_for_concurrent_mark (obj->data))
+ sgen_los_pin_object (obj->data);
return obj->data;
}
{
LOSObject *obj = sgen_los_header_for_object (data);
obj->size = obj->size | 1;
+ binary_protocol_pin (data, (gpointer)SGEN_LOAD_VTABLE (data), sgen_safe_object_get_size ((MonoObject*)data));
}
void
*(void**)obj = NULL;
#ifdef SGEN_CONCURRENT_MARK
- if (obj)
- sgen_remember_major_object_for_concurrent_mark (obj);
+ if (obj && sgen_remember_major_object_for_concurrent_mark (obj)) {
+ MSBlockInfo *block = MS_BLOCK_FOR_OBJ (obj);
+ int word, bit;
+ MS_CALC_MARK_BIT (word, bit, obj);
+ MS_SET_MARK_BIT (block, word, bit);
+ binary_protocol_mark (obj, NULL, size);
+ }
#endif
return obj;
} else {
if (sgen_los_object_is_pinned (obj))
return;
- binary_protocol_pin (obj, (gpointer)SGEN_LOAD_VTABLE (obj), sgen_safe_object_get_size ((MonoObject*)obj));
if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
MonoVTable *vt = (MonoVTable*)SGEN_LOAD_VTABLE (obj);
MONO_GC_OBJ_PINNED ((mword)obj, sgen_safe_object_get_size (obj), vt->klass->name_space, vt->klass->name, GENERATION_OLD);