*/
/* Vtable of the objects used to fill out nursery fragments before a collection */
-static GCVTable *array_fill_vtable;
+static GCVTable array_fill_vtable;
-static GCVTable*
+static GCVTable
get_array_fill_vtable (void)
{
if (!array_fill_vtable) {
vtable->gc_descr = mono_gc_make_descr_for_array (TRUE, &bmap, 0, 1);
vtable->rank = 1;
- array_fill_vtable = (GCVTable*)vtable;
+ array_fill_vtable = vtable;
}
return array_fill_vtable;
}
#ifdef ENABLE_DTRACE
if (G_UNLIKELY (MONO_GC_FINALIZE_ENQUEUE_ENABLED ())) {
int gen = sgen_ptr_in_nursery (obj) ? GENERATION_NURSERY : GENERATION_OLD;
- GCVTable *vt = (GCVTable*)SGEN_LOAD_VTABLE (obj);
+ GCVTable vt = (GCVTable)SGEN_LOAD_VTABLE (obj);
MONO_GC_FINALIZE_ENQUEUE ((mword)obj, sgen_safe_object_get_size (obj),
sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt), gen,
sgen_client_object_has_critical_finalizer (obj));
MonoVTable *vt = (MonoVTable*)SGEN_LOAD_VTABLE (obj);
MonoClass *klass = vt->klass;
- SGEN_ASSERT (0, SGEN_VTABLE_HAS_REFERENCES ((GCVTable*)vt), "Why would we ever call this on reference-free objects?");
+ SGEN_ASSERT (0, SGEN_VTABLE_HAS_REFERENCES (vt), "Why would we ever call this on reference-free objects?");
if (vt->rank) {
guint8 *card_data, *card_base;
#ifndef DISABLE_CRITICAL_REGION
ENTER_CRITICAL_REGION;
- arr = sgen_try_alloc_obj_nolock ((GCVTable*)vtable, size);
+ arr = sgen_try_alloc_obj_nolock (vtable, size);
if (arr) {
/*This doesn't require fencing since EXIT_CRITICAL_REGION already does it for us*/
arr->max_length = (mono_array_size_t)max_length;
LOCK_GC;
- arr = sgen_alloc_obj_nolock ((GCVTable*)vtable, size);
+ arr = sgen_alloc_obj_nolock (vtable, size);
if (G_UNLIKELY (!arr)) {
UNLOCK_GC;
return mono_gc_out_of_memory (size);
if (G_UNLIKELY (alloc_events))
mono_profiler_allocation (&arr->obj);
- SGEN_ASSERT (6, SGEN_ALIGN_UP (size) == SGEN_ALIGN_UP (sgen_client_par_object_get_size ((GCVTable*)vtable, (GCObject*)arr)), "Vector has incorrect size.");
+ SGEN_ASSERT (6, SGEN_ALIGN_UP (size) == SGEN_ALIGN_UP (sgen_client_par_object_get_size (vtable, (GCObject*)arr)), "Vector has incorrect size.");
return arr;
}
#ifndef DISABLE_CRITICAL_REGION
ENTER_CRITICAL_REGION;
- arr = sgen_try_alloc_obj_nolock ((GCVTable*)vtable, size);
+ arr = sgen_try_alloc_obj_nolock (vtable, size);
if (arr) {
/*This doesn't require fencing since EXIT_CRITICAL_REGION already does it for us*/
arr->max_length = (mono_array_size_t)max_length;
LOCK_GC;
- arr = sgen_alloc_obj_nolock ((GCVTable*)vtable, size);
+ arr = sgen_alloc_obj_nolock (vtable, size);
if (G_UNLIKELY (!arr)) {
UNLOCK_GC;
return mono_gc_out_of_memory (size);
if (G_UNLIKELY (alloc_events))
mono_profiler_allocation (&arr->obj);
- SGEN_ASSERT (6, SGEN_ALIGN_UP (size) == SGEN_ALIGN_UP (sgen_client_par_object_get_size ((GCVTable*)vtable, (GCObject*)arr)), "Array has incorrect size.");
+ SGEN_ASSERT (6, SGEN_ALIGN_UP (size) == SGEN_ALIGN_UP (sgen_client_par_object_get_size (vtable, (GCObject*)arr)), "Array has incorrect size.");
return arr;
}
#ifndef DISABLE_CRITICAL_REGION
ENTER_CRITICAL_REGION;
- str = sgen_try_alloc_obj_nolock ((GCVTable*)vtable, size);
+ str = sgen_try_alloc_obj_nolock (vtable, size);
if (str) {
/*This doesn't require fencing since EXIT_CRITICAL_REGION already does it for us*/
str->length = len;
LOCK_GC;
- str = sgen_alloc_obj_nolock ((GCVTable*)vtable, size);
+ str = sgen_alloc_obj_nolock (vtable, size);
if (G_UNLIKELY (!str)) {
UNLOCK_GC;
return mono_gc_out_of_memory (size);
}
gboolean
-sgen_client_vtable_is_inited (GCVTable *gc_vtable)
+sgen_client_vtable_is_inited (MonoVTable *vt)
{
- MonoVTable *vt = (MonoVTable*)gc_vtable;
return vt->klass->inited;
}
const char*
-sgen_client_vtable_get_namespace (GCVTable *gc_vtable)
+sgen_client_vtable_get_namespace (MonoVTable *vt)
{
- MonoVTable *vt = (MonoVTable*)gc_vtable;
return vt->klass->name_space;
}
const char*
-sgen_client_vtable_get_name (GCVTable *gc_vtable)
+sgen_client_vtable_get_name (MonoVTable *vt)
{
- MonoVTable *vt = (MonoVTable*)gc_vtable;
return vt->klass->name;
}