The enclosed patch causes that only the depth of the catch ranges be computed: this allows for tighter mem handling in tebc, which needs to alloc memory for each catch nesting level.
OTOH:
(1) the nesting level of loops is an interesting datum for stats and debugging, and it gets lost
(2) the mem required for each catch nesting level is just sizeof(Tcl_Obj *) - nothing. So overestimating it as now is cheap. Also, bodies with very deep nesting of loop bodies should be very rare.
This is a RFC.
Logged In: YES
user_id=148712
Originator: YES
Forget for now - segfaults :(
Logged In: YES
user_id=148712
Originator: YES
Sorry, wrong patch - corrected now.
File Added: exceptDiff3
Logged In: YES
user_id=148712
Originator: YES
File Added: exceptDiff4
Logged In: YES
user_id=79902
Originator: NO
I'm not 100% sure that the comment is maximally informative :-) but the technical content of the patch looks reasonable.
I am left wondering whether it would be possible to have some way of detecting the type of exception range at compile time, allowing for some streamlining of the compiler as well as TEBC.