8000 Move `object_id` in attributes by casperisfine · Pull Request #13159 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Move object_id in attributes #13159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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 bootstraptest/test_ractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ class C
:ok
}

# Generic ivtbl
# Generic fields_tbl
n = N/2
assert_equal "#{n}#{n}", %Q{
2.times.map{
Expand Down
6 changes: 3 additions & 3 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class_alloc(VALUE flags, VALUE klass)
/* ZALLOC
RCLASS_CONST_TBL(obj) = 0;
RCLASS_M_TBL(obj) = 0;
RCLASS_IV_INDEX_TBL(obj) = 0;
RCLASS_FIELDS(obj) = 0;
RCLASS_SET_SUPER((VALUE)obj, 0);
RCLASS_SUBCLASSES(obj) = NULL;
RCLASS_PARENT_SUBCLASSES(obj) = NULL;
Expand Down Expand Up @@ -485,7 +485,7 @@ copy_tables(VALUE clone, VALUE orig)
if (!RB_TYPE_P(clone, T_ICLASS)) {
st_data_t id;

rb_iv_tbl_copy(clone, orig);
rb_fields_tbl_copy(clone, orig);
CONST_ID(id, "__tmp_classpath__");
rb_attr_delete(clone, id);
CONST_ID(id, "__classpath__");
Expand Down Expand Up @@ -679,7 +679,7 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE 8000 attach)
}

RCLASS_SET_SUPER(clone, RCLASS_SUPER(klass));
rb_iv_tbl_copy(clone, klass);
rb_fields_tbl_copy(clone, klass);
if (RCLASS_CONST_TBL(klass)) {
struct clone_const_arg arg;
arg.tbl = RCLASS_CONST_TBL(clone) = rb_id_table_create(0);
Expand Down
18 changes: 9 additions & 9 deletions ext/objspace/objspace_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ dump_object(VALUE obj, struct dump_config *dc)
}

dump_append(dc, ", \"ivars\":");
dump_append_lu(dc, ROBJECT_IV_COUNT(obj));
dump_append_lu(dc, ROBJECT_FIELDS_COUNT(obj));
if (rb_shape_obj_too_complex(obj)) {
dump_append(dc, ", \"too_complex_shape\":true");
}
Expand Down Expand Up @@ -805,29 +805,29 @@ shape_i(rb_shape_t *shape, void *data)
dump_append(dc, ", \"depth\":");
dump_append_sizet(dc, rb_shape_depth(shape));

dump_append(dc, ", \"shape_type\":");
switch((enum shape_type)shape->type) {
case SHAPE_ROOT:
dump_append(dc, "\"ROOT\"");
dump_append(dc, ", \"shape_type\":\"ROOT\"");
break;
case SHAPE_IVAR:
dump_append(dc, "\"IVAR\"");
dump_append(dc, ", \"shape_type\":\"IVAR\"");

dump_append(dc, ",\"edge_name\":");
dump_append_id(dc, shape->edge_name);

break;
case SHAPE_FROZEN:
dump_append(dc, "\"FROZEN\"");
dump_append(dc, ", \"shape_type\":\"FROZEN\"");
break;
case SHAPE_T_OBJECT:
dump_append(dc, "\"T_OBJECT\"");
dump_append(dc, ", \"shape_type\":\"T_OBJECT\"");
break;
case SHAPE_OBJ_TOO_COMPLEX:
dump_append(dc, "\"OBJ_TOO_COMPLEX\"");
dump_append(dc, ", \"shape_type\":\"OBJ_TOO_COMPLEX\"");
break;
case SHAPE_OBJ_ID:
dump_append(dc, ", \"shape_type\":\"OBJ_ID\"");
break;
default:
rb_bug("[objspace] unexpected shape type");
}

dump_append(dc, ", \"edges\":");
Expand Down
Loading
Loading
0