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-October/039397.html below:

[Python-Dev] setjmp/longjmp exception handling (was: More informative error messages)

[Python-Dev] setjmp/longjmp exception handling (was: More informative error messages) [Python-Dev] setjmp/longjmp exception handling (was: More informative error messages)Martin v. Löwis martin at v.loewis.de
Thu Oct 23 16:30:16 EDT 2003
"Brett C." <bac at OCF.Berkeley.EDU> writes:

> The basic idea is to keep a stack of jmp_buf points.

This is an old implementation strategy for exceptions in C++; e.g. GNU
g++ uses it with -fsjlj-exception option. It is generally discouraged
as it is *really* expensive: it requires a lot of memory per jmpbuf,
and it requires that the memory is filled.

In addition, for Python, there would be no simplification: each stack
frame needs to perform "all" DECREFs. To convert this to exception
handling, you would get very many nested try-catch blocks, as each
allocation of some object would need to be followed with a try-catch
block. So if you have 5 objects allocated in a function, you would
need a nesting of 5 levels - i.e. up to column 40.

Regards,
Martin


More information about the Python-Dev mailing list

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