summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-06-16 11:19:12 +0200
committerJean Boussier <[email protected]>2025-06-17 15:28:05 +0200
commitcd9f447be247478d2eb3da985295735cce20cb23 ()
tree1f87f079323e42a71f07b862b6d32daa6260e5b7 /ext
parent164486a954e3cf3e716393c5f9a9e2c4dd776993 (diff)
Refactor generic fields to use `T_IMEMO/fields` objects.
Followup: https://.com/ruby/ruby/pull/13589 This simplify a lot of things, as we no longer need to manually manage the memory, we can use the Read-Copy-Update pattern and avoid numerous race conditions. Co-Authored-By: Étienne Barrié <[email protected]>
Notes: Merged: https://.com/ruby/ruby/pull/13626
-rw-r--r--ext/objspace/objspace_dump.c9
1 files changed, 5 insertions, 4 deletions
@@ -394,9 +394,10 @@ dump_object(VALUE obj, struct dump_config *dc)
dc->cur_obj = obj;
dc->cur_obj_references = 0;
- if (BUILTIN_TYPE(obj) == T_NODE || BUILTIN_TYPE(obj) == T_IMEMO) {
dc->cur_obj_klass = 0;
- } else {
dc->cur_obj_klass = RBASIC_CLASS(obj);
}
@@ -414,8 +415,8 @@ dump_object(VALUE obj, struct dump_config *dc)
dump_append(dc, obj_type(obj));
dump_append(dc, "\"");
- if (BUILTIN_TYPE(obj) != T_IMEMO) {
- size_t shape_id = rb_obj_shape_id(obj);
dump_append(dc, ", \"shape_id\":");
dump_append_sizet(dc, shape_id);
}