diff options
author | Peter Zhu <[email protected]> | 2021-08-02 14:22:47 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2021-10-25 13:26:23 -0400 |
commit | 6374be5a8188ff5ed2c70b9f1d76672c87a0eda7 (patch) | |
tree | 6ac8436f9e29bede5bf7ad167625c47082e5291e /gc.c | |
parent | 46b66eb9e8e6de2d5750591e532310e8f8599d90 (diff) |
[Feature #18239] Refactor RVARGC alloc functions
The allocation functions no longer assume that one RVALUE needs to be
allocated.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4933
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4577,7 +4577,9 @@ obj_memsize_of(VALUE obj, int use_all_types) if (RCLASS_CC_TBL(obj)) { size += cc_table_memsize(RCLASS_CC_TBL(obj)); } +#if !USE_RVARGC size += sizeof(rb_classext_t); +#endif } break; case T_ICLASS: @@ -4666,7 +4668,7 @@ obj_memsize_of(VALUE obj, int use_all_types) BUILTIN_TYPE(obj), (void*)obj); } - return size + sizeof(RVALUE); + return size + GET_HEAP_PAGE(obj)->slot_size; } size_t |