Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
if [[ ${{ matrix.gc.mmtk_build }} == debug ]]; then
echo 'RUST_LOG=' >> $GITHUB_ENV
echo 'RUBY_TEST_TIMEOUT_SCALE=20' >> $GITHUB_ENV
echo 'SYNTAX_SUGGEST_TIMEOUT=60' >> $GITHUB_ENV
echo 'SYNTAX_SUGGEST_TIMEOUT=120' >> $GITHUB_ENV
fi
echo "EXCLUDES=$PWD/test/.excludes-mmtk" >> $GITHUB_ENV
echo "MSPECOPT=-B$PWD/spec/mmtk.mspec" >> $GITHUB_ENV
Expand Down
4 changes: 4 additions & 0 deletions gc/mmtk/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
MMTK_BUILD = debug
LIBMMTK_RUBY = libmmtk_ruby.#$LIBEXT
RUSTSRCS = #{rustsrcs.join(" \\\n\t ")}

ifeq ($(MMTK_BUILD), debug)
CPPFLAGS += -DMMTK_DEBUG
endif
MAKEFILE
]
end
12 changes: 12 additions & 0 deletions gc/mmtk/mmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,18 @@ rb_gc_impl_writebarrier(void *objspace_ptr, VALUE a, VALUE b)

if (SPECIAL_CONST_P(b)) return;

#ifdef MMTK_DEBUG
if (!rb_gc_impl_pointer_to_heap_p(objspace_ptr, (void *)a)) {
char buff[256];
rb_bug("a: %s is not an object", rb_raw_obj_info(buff, 256, a));
}

if (!rb_gc_impl_pointer_to_heap_p(objspace_ptr, (void *)b)) {
char buff[256];
rb_bug("b: %s is not an object", rb_raw_obj_info(buff, 256, b));
}
#endif

mmtk_object_reference_write_post(cache->mutator, (MMTk_ObjectReference)a);
}

Expand Down