Skip updating max_iv_count when the namespace cannot be determined
This commit is contained in:
parent
c2c5b05423
commit
bbcc3782b1
7
gc.c
7
gc.c
@ -3192,9 +3192,14 @@ rb_gc_mark_children(void *objspace, VALUE obj)
|
|||||||
if (fields_count) {
|
if (fields_count) {
|
||||||
VALUE klass = RBASIC_CLASS(obj);
|
VALUE klass = RBASIC_CLASS(obj);
|
||||||
|
|
||||||
|
// Skip updating max_iv_count if the prime classext is not writable
|
||||||
|
// because GC context doesn't provide information about namespaces.
|
||||||
|
if (RCLASS_PRIME_CLASSEXT_WRITABLE_P(klass)) {
|
||||||
|
VM_ASSERT(rb_shape_obj_too_complex_p(klass));
|
||||||
// Increment max_iv_count if applicable, used to determine size pool allocation
|
// Increment max_iv_count if applicable, used to determine size pool allocation
|
||||||
if (RCLASS_MAX_IV_COUNT(klass) < fields_count) {
|
if (RCLASS_MAX_IV_COUNT(klass) < fields_count) {
|
||||||
RCLASS_WRITE_MAX_IV_COUNT(klass, fields_count);
|
RCLASS_SET_MAX_IV_COUNT(klass, fields_count);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user