Ticket UUID: | 3008541 | |||
Title: | order of TIP #348 fields in Interp structure | |||
Type: | Patch | Version: | None | |
Submitter: | nijtmans | Created on: | 2010-05-28 13:30:59 | |
Subsystem: | None | Assigned To: | ferrieux | |
Priority: | 3 Low | Severity: | ||
Status: | Closed | Last Modified: | 2010-05-28 20:58:54 | |
Resolution: | Fixed | Closed By: | nijtmans | |
Closed on: | 2010-05-28 13:58:54 | |||
Description: |
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 | |||
User Comments: |
nijtmans added on 2010-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". ferrieux added on 2010-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... nijtmans added on 2010-05-28 20:31:00: File Added - 375459: tclInt.h.patch |
Attachments:
- tclInt.h.patch [download] added by nijtmans on 2010-05-28 20:30:59. [details]