From: SourceForge.net <no...@so...> - 2006-08-10 12:19:56
|
Patches item #1530474, was opened at 2006-07-28 16:46 Message generated for change (Settings changed) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=310894&aid=1530474&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 4 Submitted By: afredd (afredd) Assigned to: Donal K. Fellows (dkf) Summary: Shrink the .exe size Initial Comment: By converting the 24 calls of: Tcl_Panic("<function> called with shared object"); in the core, into a (new) function call of TclSharedObjPanic("<function>"); ...where TclSharedObjPanic() constructs the previous message before calling Tcl_Panic() then the static .exe shrinks by about 4K (from 770048 to 765952). This is more than i'd expected, so compilers other than VS6 may give less impressive savings. Attached patch includes the trivial changes to tclBinary.c tclDictObj.c tclInt.h tclListObj.c tclObj.c tclStringObj.c ---------------------------------------------------------------------- >Comment By: Donal K. Fellows (dkf) Date: 2006-08-10 13:19 Message: Logged In: YES user_id=79902 Applied fixes suggested. Will not backport. ---------------------------------------------------------------------- Comment By: afredd (afredd) Date: 2006-08-07 15:17 Message: Logged In: YES user_id=1386588 Another few bytes can be saved by removing the redundant first "if (objc < 1)" test in Tcl_UnsetObjCmd. ie. are there a negative number of command arguments. Looks like a harmless mistranslation of the code for the old behaviour when [unset] was an error. Anyways saves a few bytes (257) from the tclVar.obj, and possibly from the .exe too. ---------------------------------------------------------------------- Comment By: afredd (afredd) Date: 2006-08-07 10:03 Message: Logged In: YES user_id=1386588 > can you (afredd) please provide the alternate patch? thx Sure - here it is. I've also added in the reworded Tcl_Panic for TclIncrObj. Note, while i haven't changed them there are 2 possible typos in the (original) panic messages. (1) The panic at ~1323 of tclListObj.c says "Tcl_ListObjSetElement" but is really in TclListObjSetElement (no underscore). (2) Similarly, at ~344 in tclBinary.c the panic in the function Tcl_SetByteArrayLength says Tcl_SetObjLength. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2006-08-04 23:59 Message: Logged In: YES user_id=72656 can you (afredd) please provide the alternate patch? thx ---------------------------------------------------------------------- Comment By: afredd (afredd) Date: 2006-08-04 09:36 Message: Logged In: YES user_id=1386588 > I'm interested to know if the same effect can be had by > just using: > > Tcl_Panic("%s called with shared object", <function>); Good idea... yes, this gives the same 4K file size reduction as with using a TclSharedObjPanic(). Also, spotted in tclExecute.c: ~1043: Tcl_Panic("shared object passed to TclIncrObj") which could be reworded to match the others. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2006-08-03 19:31 Message: Logged In: YES user_id=72656 I'm interested to know if the same effect can be had by just using: Tcl_Panic("%s called with shared object", <function>); as the string would remain the same, and no new function is needed (Tcl_Panic already handles varargs). If so, that would be a trivially easy to add in patch. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2006-08-03 18:04 Message: Logged In: YES user_id=79902 Putting this on the back-burner for now; better to do this sort of thing during (towards the end of?) the beta cycle. ---------------------------------------------------------------------- Comment By: afredd (afredd) Date: 2006-07-28 17:59 Message: Logged In: YES user_id=1386588 ...and one for tclClock.c that shrinks tclClock.obj from 23,417 to 23,201 by condensing the clock command initialisation code. ---------------------------------------------------------------------- Comment By: afredd (afredd) Date: 2006-07-28 17:08 Message: Logged In: YES user_id=1386588 To go with the previous changes, here's a patch that removes the need for the "::tcl::mathfunc::" prefix on all math function name static strings in tclBasic.c. For me this shrinks tclBasic.obj from 80963 to 79965, a saving of 998bytes. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=310894&aid=1530474&group_id=10894 |