summaryrefslogtreecommitdiff
path: root/gc
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-04-21 10:21:55 +0900
committerJean Boussier <[email protected]>2025-04-24 10:14:29 +0200
commitcb1ea54bbf6cdf49c53f42720fec1a151069810c (patch)
tree4f4ae5a0bc938c57a78a8fab4d9b57530118fa85 /gc
parent7af5a632f42b031767cc211543aa4aee75b6fafc (diff)
objspace_dump: Include `shareable` flag
Given that the currently planned ractor local GC implementation performance will heavilly be influenced by the number of shareable objects it would be valuable to be able to know how many of them are in the heap.
Diffstat (limited to 'gc')
-rw-r--r--gc/default/default.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gc/default/default.c b/gc/default/default.c
index ec905ac361..124c5de3eb 100644
--- a/gc/default/default.c
+++ b/gc/default/default.c
@@ -6199,7 +6199,7 @@ rb_gc_impl_object_metadata(void *objspace_ptr, VALUE obj)
{
rb_objspace_t *objspace = objspace_ptr;
size_t n = 0;
- static ID ID_wb_protected, ID_age, ID_old, ID_uncollectible, ID_marking, ID_marked, ID_pinned, ID_object_id;
+ static ID ID_wb_protected, ID_age, ID_old, ID_uncollectible, ID_marking, ID_marked, ID_pinned, ID_object_id, ID_shareable;
if (!ID_marked) {
#define I(s) ID_##s = rb_intern(#s);
@@ -6211,6 +6211,7 @@ rb_gc_impl_object_metadata(void *objspace_ptr, VALUE obj)
I(marked);
I(pinned);
I(object_id);
+ I(shareable);
#undef I
}
@@ -6229,6 +6230,7 @@ rb_gc_impl_object_metadata(void *objspace_ptr, VALUE obj)
if (RVALUE_MARKED(objspace, obj)) SET_ENTRY(marked, Qtrue);
if (RVALUE_PINNED(objspace, obj)) SET_ENTRY(pinned, Qtrue);
if (FL_TEST(obj, FL_SEEN_OBJ_ID)) SET_ENTRY(object_id, rb_obj_id(obj));
+ if (FL_TEST(obj, FL_SHAREABLE)) SET_ENTRY(shareable, Qtrue);
object_metadata_entries[n].name = 0;
object_metadata_entries[n].val = 0;