summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-01-30 06:04:13 -0800
committerKaz Kylheku <kaz@kylheku.com>2025-01-30 06:04:13 -0800
commit81b5e08190cbb76a8bf02a4204d538800e1a9f1a (patch)
tree7e6160be9c7d84b43794505dd09b84df42a7e787 /stdlib
parent707ab6c2626575cd090a2ba02db17306a25d49ed (diff)
downloadtxr-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