#ifdef HAVE_SGEN_GC
-#include "sgen-gc.h"
+#include "sgen/sgen-gc.h"
#include "sgen-toggleref.h"
+#include "sgen/sgen-client.h"
/*only one of the two can be non null at a given time*/
w);
}
-void
-sgen_scan_togglerefs (char *start, char *end, ScanCopyContext ctx)
+void sgen_client_mark_togglerefs (char *start, char *end, ScanCopyContext ctx)
{
- CopyOrMarkObjectFunc copy_func = ctx.copy_func;
+ CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
SgenGrayQueue *queue = ctx.queue;
int i;
- SGEN_LOG (4, "Scanning ToggleRefs %d", toggleref_array_size);
+ SGEN_LOG (4, "Marking ToggleRefs %d", toggleref_array_size);
for (i = 0; i < toggleref_array_size; ++i) {
if (toggleref_array [i].strong_ref) {
SGEN_LOG (6, "\tcopying strong slot %d", i);
copy_func (&toggleref_array [i].strong_ref, queue);
}
- } else if (toggleref_array [i].weak_ref) {
+ }
+ }
+ sgen_drain_gray_stack (-1, ctx);
+}
+
+void sgen_client_clear_togglerefs (char *start, char *end, ScanCopyContext ctx)
+{
+ CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object;
+ SgenGrayQueue *queue = ctx.queue;
+ int i;
+
+ SGEN_LOG (4, "Clearing ToggleRefs %d", toggleref_array_size);
+
+ for (i = 0; i < toggleref_array_size; ++i) {
+ if (toggleref_array [i].weak_ref) {
char *object = toggleref_array [i].weak_ref;
if (object >= start && object < end) {
}
}
}
+ sgen_drain_gray_stack (-1, ctx);
}
static void