summaryrefslogtreecommitdiff
path: root/ext/objspace
diff options
context:
space:
mode:
Diffstat (limited to 'ext/objspace')
-rw-r--r--ext/objspace/object_tracing.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/objspace/object_tracing.c b/ext/objspace/object_tracing.c
index 9de9724400..1770a8ea39 100644
--- a/ext/objspace/object_tracing.c
+++ b/ext/objspace/object_tracing.c
@@ -98,8 +98,13 @@ newobj_i(VALUE tpval, void *data)
VALUE class_path = RTEST(klass) ? rb_class_path(klass) : Qnil;
const char *class_path_cstr = RTEST(class_path) ? make_unique_str(arg->str_table, RSTRING_PTR(class_path), RSTRING_LEN(class_path)) : 0;
- if (arg->keep_remains && st_lookup(arg->object_table, (st_data_t)obj, (st_data_t *)&info)) {
- if (0 /* workaround */) if (info->living) rb_bug("newobj_i: reuse living object: %p", (void *)obj);
+ if (st_lookup(arg->object_table, (st_data_t)obj, (st_data_t *)&info)) {
+ if (arg->keep_remains) {
+ if (info->living) {
+ /* do nothing. there is possibility to keep living if FREEOBJ events while suppressing tracing */
+ }
+ }
+ /* reuse info */
delete_unique_str(arg->str_table, info->path);
delete_unique_str(arg->str_table, info->class_path);
}