diff options
author | John Hawthorn <[email protected]> | 2025-05-23 10:49:21 -0700 |
---|---|---|
committer | John Hawthorn <[email protected]> | 2025-05-29 16:02:07 -0400 |
commit | 6a62a46c3cd8a0fe3623b5363ff21ead1e755169 (patch) | |
tree | de2f13c708a66ac05db368a5a75c60b715d53450 /class.c | |
parent | 5b3f1c4c51480cbdbd1ace92b1767f14f9fff280 (diff) |
Read {max_iv,variation}_count from prime classext
MAX_IV_COUNT is a hint which determines the size of variable width
allocation we should use for a given class. We don't need to scope this
by namespace, if we end up with larger builtin objects on some
namespaces that isn't a user-visible problem, just extra memory use.
Similarly variation_count is used to track if a given object has had too
many branches in shapes it has used, and to use too_complex when that
happens. That's also just a hint, so we can use the same value across
namespaces without it being visible to users.
Previously variation_count was being incremented (written to) on the
RCLASS_EXT_READABLE ext, which seems incorrect if we wanted it to be
different across namespaces
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13434
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -338,9 +338,9 @@ rb_class_duplicate_classext(rb_classext_t *orig, VALUE klass, const rb_namespace * * refined_class * * as.class.allocator / as.singleton_class.attached_object * * includer + * * max IV count + * * variation count */ - RCLASSEXT_MAX_IV_COUNT(ext) = RCLASSEXT_MAX_IV_COUNT(orig); - RCLASSEXT_VARIATION_COUNT(ext) = RCLASSEXT_VARIATION_COUNT(orig); RCLASSEXT_PERMANENT_CLASSPATH(ext) = RCLASSEXT_PERMANENT_CLASSPATH(orig); RCLASSEXT_CLONED(ext) = RCLASSEXT_CLONED(orig); RCLASSEXT_CLASSPATH(ext) = RCLASSEXT_CLASSPATH(orig); |