A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-April/034455.html below:

[Python-Dev] Re: tp_clear return value

[Python-Dev] Re: tp_clear return valueTim Peters tim_one@email.msn.com
Thu, 10 Apr 2003 01:03:42 -0400
[Neil Schemenauer]
>> Could the visit procedure keep track of errors?

[Martin v. Löwis]
> No. For get_referrers (as Tim explains), it might be acceptable but
> less efficient (since traversal should stop when a the object is found
> to be a referrer). For get_referents, an error in the callback should
> really abort traversal as the system just went out of memory.

Still, I expect both could be handled by setjmp in the gc module get_ref*
driver functions and longjmp (as needed) in the gc module visitor functions.
IOW, the tp_traverse slot functions don't really need to cooperate, or even
know anything about "early returns".

Why this may be more than just idly interesting:  the tp_traverse functions
are called a lot by gc.  The get_ref* functions are never called except when
explicitly asked for, and their speed just doesn't matter.  Burdening them
with funky control flow would be a real win if eliminating
almost-always-useless test/branch constructs in often-called tp_traverse
slots sped the latter.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4