-/*
- * sgen-copy-object.h: This is where objects are copied.
+/**
+ * \file
+ * This is where objects are copied.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
if (has_references) {
SGEN_LOG (9, "Enqueuing gray object %p (%s)", destination, sgen_client_vtable_get_name (vt));
- GRAY_OBJECT_ENQUEUE (queue, (GCObject *)destination, sgen_vtable_get_descriptor (vt));
+ GRAY_OBJECT_ENQUEUE_SERIAL (queue, (GCObject *)destination, sgen_vtable_get_descriptor (vt));
}
return (GCObject *)destination;
/* In a racing case, only the worker that allocated the object enqueues it */
if (has_references) {
SGEN_LOG (9, "Enqueuing gray object %p (%s)", destination, sgen_client_vtable_get_name (vt));
- GRAY_OBJECT_ENQUEUE (queue, (GCObject *)destination, sgen_vtable_get_descriptor (vt));
+ GRAY_OBJECT_ENQUEUE_PARALLEL (queue, (GCObject *)destination, sgen_vtable_get_descriptor (vt));
}
} else {
+ /*
+ * Unlikely case. Clear the allocated object so it doesn't confuse nursery
+ * card table scanning, since it can contain old invalid refs.
+ * FIXME make sure it is not a problem if another threads scans it while we clear
+ */
+ mono_gc_bzero_aligned (destination, objsize);
destination = final_destination;
}
}