summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2021-11-10 21:33:17 +0000
committerPeter Zhu <peter@peterzhu.ca>2021-11-11 13:47:45 -0500
commita9a94540d68b523ecc4e2181e50b320cd5d176f1 (patch)
tree4294632b83889625c3fbf5ba117f7fbc22ee1a8a /gc.c
parentd08d13700c6527eb117af5df0a6c16e40aba6348 (diff)
Remove RCLASS(obj)->ptr when RVARGC is enabled
With RVARGC we always store the rb_classext_t in the same slot as the RClass struct that refers to it. So we don't need to store the pointer or access through the pointer anymore and can switch the RCLASS_EXT macro to use an offset
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5101
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index 94c7f60c95..2c64460541 100644
--- a/gc.c
+++ b/gc.c
@@ -4588,11 +4588,11 @@ obj_memsize_of(VALUE obj, int use_all_types)
// TODO: more correct value
size += st_memsize(RCLASS_IV_INDEX_TBL(obj));
}
- if (RCLASS(obj)->ptr->iv_tbl) {
- size += st_memsize(RCLASS(obj)->ptr->iv_tbl);
+ if (RCLASS_EXT(obj)->iv_tbl) {
+ size += st_memsize(RCLASS_EXT(obj)->iv_tbl);
}
- if (RCLASS(obj)->ptr->const_tbl) {
- size += rb_id_table_memsize(RCLASS(obj)->ptr->const_tbl);
+ if (RCLASS_EXT(obj)->const_tbl) {
+ size += rb_id_table_memsize(RCLASS_EXT(obj)->const_tbl);
}
if (RCLASS_CC_TBL(obj)) {
size += cc_table_memsize(RCLASS_CC_TBL(obj));