diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-05-02 06:55:30 +0200 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2026-05-02 08:46:36 +0200 |
| commit | 45d586ad60ba807dbb8c5f17b0ac156095eb4fbf (patch) | |
| tree | da3403fc52f4e4d4ded5b57a6231c84d54c1941b /object.c | |
| parent | f2845eab29cf4e52af447a4041b5888c0e582882 (diff) | |
Never increment `max_iv_count` on Object / BasicObject.
Otherwise some code defining ivars on a naked object early during
program boot can cause all objects to be larger than needed.
This seem like it was always the intention, but wasn't quite
properly prevented.
Also stop updating `max_iv_count` during GC marking as it is
redundant.
Diffstat (limited to 'object.c')
| -rw-r--r-- | object.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -2224,6 +2224,7 @@ rb_class_initialize(int argc, VALUE *argv, VALUE klass) } } rb_class_set_super(klass, super); + RCLASS_SET_MAX_IV_COUNT(klass, RCLASS_MAX_IV_COUNT(super)); RCLASS_SET_ALLOCATOR(klass, RCLASS_ALLOCATOR(super)); rb_make_metaclass(klass, RBASIC(super)->klass); rb_class_inherited(super, klass); |
