diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-01-05 10:55:44 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-01-05 16:00:36 -0500 |
commit | 2056c0a7c680350cf92a134e355c03e1efb10549 (patch) | |
tree | d452a4c3718d14832f15ce7742b33c53d03305ea /ext/objspace/objspace_dump.c | |
parent | 53938efd7b0ac868b177b3e748996a3aef4bccb6 (diff) |
Add embedded status to dumps of T_OBJECT
This commit adds `"embedded":true` in ObjectSpace.dump for T_OBJECTs
that are embedded.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7068
Diffstat (limited to 'ext/objspace/objspace_dump.c')
-rw-r--r-- | ext/objspace/objspace_dump.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c index c3cc9a1e7b..f101b334c1 100644 --- a/ext/objspace/objspace_dump.c +++ b/ext/objspace/objspace_dump.c @@ -544,6 +544,10 @@ dump_object(VALUE obj, struct dump_config *dc) break; case T_OBJECT: + if (FL_TEST(obj, ROBJECT_EMBED)) { + dump_append(dc, ", \"embedded\":true"); + } + dump_append(dc, ", \"ivars\":"); dump_append_lu(dc, ROBJECT_IV_COUNT(obj)); if (rb_shape_obj_too_complex(obj)) { |