}
void
-sgen_scan_togglerefs (CopyOrMarkObjectFunc copy_func, char *start, char *end, SgenGrayQueue *queue)
+sgen_scan_togglerefs (char *start, char *end, ScanCopyContext ctx)
{
+ CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+ SgenGrayQueue *queue = ctx.queue;
int i;
SGEN_LOG (4, "Scanning ToggleRefs %d", toggleref_array_size);
MonoGCToggleRef *tmp;
int old_capacity = toggleref_array_capacity;
while (toggleref_array_capacity < toggleref_array_size + capacity)
- toggleref_array_size *= 2;
+ toggleref_array_capacity *= 2;
tmp = sgen_alloc_internal_dynamic (
toggleref_array_capacity * sizeof (MonoGCToggleRef),
toggleref_callback = proccess_toggleref;
}
+static MonoToggleRefStatus
+test_toggleref_callback (MonoObject *obj)
+{
+ static MonoClassField *mono_toggleref_test_field;
+ int status = MONO_TOGGLE_REF_DROP;
+
+ if (!mono_toggleref_test_field) {
+ mono_toggleref_test_field = mono_class_get_field_from_name (mono_object_get_class (obj), "__test");
+ g_assert (mono_toggleref_test_field);
+ }
+
+ mono_field_get_value (obj, mono_toggleref_test_field, &status);
+ printf ("toggleref-cb obj %d\n", status);
+ return status;
+}
+
+void
+sgen_register_test_toggleref_callback (void)
+{
+ toggleref_callback = test_toggleref_callback;
+}
+
#endif