Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2010-05-28
20:58 • Closed ticket [3008541fff]: order of TIP #348 fields in Interp structure plu... artifact: 8e04aaaece user: nijtmans
20:42 • Ticket [3008541fff]: 4 changes artifact: ccecd86471 user: ferrieux
20:31 • Ticket [3008541fff]: 4 changes artifact: cb2630c9b4 user: nijtmans
20:30 • Add attachment tclInt.h.patch to ticket [3008541fff] artifact: b6d63d67a6 user: nijtmans
13:30 • New ticket [3008541fff] order of TIP #348 fields in Interp structure. artifact: f7eff59697 user: nijtmans

order of TIP #348 fields in Interp structure

Closed / Fixed3008541fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-05-28 13:30:59
When the TIP #348 fields were added to the Interp
structure, all fields after that where shifted up. This
means that any extension which uses any of those
internal Interp fields needs to be recompiled, or 
it will stop working.

Suggestion: When adding fields to a structure, please
do that in a clearly marked region at the end of the
structure. See patch. Agreed? (no offence)....

P.S. ByteCodeStats stats should be the
last field, otherwise the field order depends on
the value of TCL_COMPILE_STATS. But
the TIP #348 implementation cannot be
blamed for that, that was my fault.......

             Jan Nijtmans
nijtmansplain2010-05-28 20:31:00
File Added - 375459: tclInt.h.patch
ferrieuxplain2010-05-28 20:42:42
Yes, Don told me that already, but since there was that conditional part with COMPILE_STATS, we agreed to do nothing :}

Now if we decide that COMPILE_STATS has a fixed value for all production code, I agree that it's better that evolution be monotonic. Please commit your patch.

Side note: the #ifdef at the end is better than in the middle, but still not bullet-proof in case of further extensions of the interp struct. I'd prefer it to be unconditional. But at the same time I see it is quite big. What about making an indirection ? In this case the 4 bytes can be harmlessly wasted and set to NULL when we don't want compilation statistics...
nijtmansplain2010-05-28 20:58:54
allow_comments - 1

Thanks, committed!

The ByteCodeStats stats at the end is indeed
not perfect, but any other solution I can think
of is not perfect either. And since changing
COMPILE_STATS means that Tcl has to
be re-compiled anyway, having this field
at the end is at least "almost perfect".
Log in (anonymous is fine) to add a comment.

Attachments: