diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-01-30 06:04:13 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-01-30 06:04:13 -0800 |
commit | 81b5e08190cbb76a8bf02a4204d538800e1a9f1a (patch) | |
tree | 7e6160be9c7d84b43794505dd09b84df42a7e787 /stdlib | |
parent | 707ab6c2626575cd090a2ba02db17306a25d49ed (diff) | |
download | txr-81b5e08190cbb76a8bf02a4204d538800e1a9f1a.tar.gz txr-81b5e08190cbb76a8bf02a4204d538800e1a9f1a.tar.bz2 txr-81b5e08190cbb76a8bf02a4204d538800e1a9f1a.zip |
cobj: optimize subclass checks based on depth 1 assumption
Nowhere in the image do we have cobj_class inheritance
deeper than one. No class has a superclass which itself
has a superclass. Based on this, we can eliminate loops
coded to handle the general case.
* lib.c (sutypep, cobjclassp): Do not iterate to chase
the chain of super pointers. Do the subclass check
based on the assumption that there is at most a super
pointer to class which itself then has no super.
(cobj_register_super): Assert if the situation occurs
that a class is registered with a super that is not
a root. All these calls take place on startup, so if
the assumption is wrong, the assert will be 100%
reproducible.
Diffstat (limited to 'stdlib')
0 files changed, 0 insertions, 0 deletions