[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
More information about the Python-Dev mailing list
Thu Oct 23 16:30:16 EDT 2003
- Previous message: [Python-Dev] setjmp/longjmp exception handling (was: More informative error messages)
- Next message: [Python-Dev] setjmp/longjmp exception handling
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"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
- Previous message: [Python-Dev] setjmp/longjmp exception handling (was: More informative error messages)
- Next message: [Python-Dev] setjmp/longjmp exception handling
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list