Skip to content

Commit 54289fc

Browse files
drmeisteryitzchak
authored andcommitted
Print a debugging message about registering literals as roots
1 parent a214dd6 commit 54289fc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gctools/boehmGarbageCollection.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,12 @@ void clasp_gc_registerRoots(void* rootsStart, size_t numberOfRoots) {
572572
void* rootsEnd = (void*)((uintptr_t)rootsStart + numberOfRoots * sizeof(void*));
573573
if (rootsEnd != rootsStart) {
574574
printf("%s:%d:%s GC_add_roots %p to %p\n", __FILE__, __LINE__, __FUNCTION__, rootsStart, rootsEnd);
575+
void* base = GC_base(rootsStart);
576+
if (base) {
577+
printf(" ---- the roots are INSIDE GC managed memory - GC_add_roots is not needed\n");
578+
} else {
579+
printf(" ---- the roots are OUTSIDE GC managed memory - GC_add_roots is NEEDED\n");
580+
}
575581
GC_add_roots(rootsStart, rootsEnd);
576582
}
577583
#endif

0 commit comments

Comments
 (0)