diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2025-09-02 13:37:53 +0200 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-09-02 09:22:27 -0400 |
| commit | 636da19e2bd01dda7f056404962b326695cc0597 (patch) | |
| tree | fd95f93c58cc9ea35a55e4a6b8b8ad9b1df35e3b | |
| parent | 8c73da9e66f1152fb1fe9a43d0aab2a2e8ac5cad (diff) | |
Output parent object info when marking T_NONE
| -rw-r--r-- | gc/default/default.c | 10 | ||||
| -rw-r--r-- | gc/gc.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gc/default/default.c b/gc/default/default.c index b7d43b0acb..aa06b7cc06 100644 --- a/gc/default/default.c +++ b/gc/default/default.c @@ -4395,7 +4395,15 @@ gc_mark_check_t_none(rb_objspace_t *objspace, VALUE obj) char obj_info_buf[256]; rb_raw_obj_info(obj_info_buf, 256, obj); - rb_bug("try to mark T_NONE object (obj: %s)", obj_info_buf); + char parent_obj_info_buf[256]; + if (objspace->rgengc.parent_object == Qfalse) { + strcpy(parent_obj_info_buf, "(none)"); + } + else { + rb_raw_obj_info(parent_obj_info_buf, 256, objspace->rgengc.parent_object); + } + + rb_bug("try to mark T_NONE object (obj: %s, parent: %s)", obj_info_buf, parent_obj_info_buf); } } @@ -58,7 +58,7 @@ RUBY_SYMBOL_EXPORT_BEGIN // files in Ruby. size_t rb_size_mul_or_raise(size_t x, size_t y, VALUE exc); void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data); -void rb_obj_info_dump(VALUE obj); +const char *rb_raw_obj_info(char *const buff, const size_t buff_size, VALUE obj); const char *rb_obj_info(VALUE obj); size_t rb_obj_memsize_of(VALUE obj); bool ruby_free_at_exit_p(void); |
