Skip to content
Tcl Source Code Artifact [24bb7599ad]
Login

Artifact [24bb7599ad]

Artifact 24bb7599ad9a260eee02212f135e57259075ea6c:

Ticket change [24bb7599ad] - New ticket [223153ffffffffff|223153ffff] <i>Binary incompatibility of 8.4a1 (Tcl_InitHashTable)</i>. by andreas_kupries on 2000-11-22 13:30:05.
D 2000-11-22T13:30:05
J assignee nobody
J cmimetype text/plain
J comment The\schange\sto\sTcl_Hashtables\sintroduced\sby\sPaul\sDuffin\s(extended\sto\sallow\suser-defined\skeys,\sespecially\sTcl_Obj's)\scontains\sa\schunk\swhich\sessentially\schanges\sthe\spublic\sAPI\sin\sa\snon-compatible\sway.\sBinaries\sof\sextensions\scompiled\sagainst\s8.4\sare\sno\slonger\suseable\swith\solder\sversions\sof\sthe\score.\sThe\schange\sin\squestion\sis\sthis\sone,\sin\stcl.h:\n\n/*\n\s*\sMacro\sto\suse\snew\sextended\sversion\sof\sTcl_InitHashTable.\n\s*/\n#define\sTcl_InitHashTable(tablePtr,\skeyType)\s\\\n\s\s\s\s\s\s\s\sTcl_InitHashTableEx(tablePtr,\skeyType,\sNULL)\n\nThe\seffect\sof\sthis\smacro\sis,\sthat\sextension\sdevelopers\sbelieve\sto\suse\sthe\sexisting\sold\sinterface\s(setting\sthe\sstubs\sversion\sto\s8.1\sor\ssomething!)\sbut\sare\squietly\srerouted\sto\sthe\snew\sone\swhen\scompiling\sagainst\s8.4.\sWhen\ssuch\sa\sbinary\sis\sused\swith\san\solder\sversion\sof\sthe\score\sit\swill\sjump\sthrough\sa\spart\sof\sthe\sstubs\stable\swhich\sdoes\snot\sexist.\sInstant\scrash.\sThis\swill\shappen\seven\sif\sTCL_PRESERVE_BINARY_COMPATABILITY\sis\sset\sduring\scompilation\sof\sTcl\sand\sof\sthe\sextension!\n\nExample:\sTrf\suses\s"Tcl_InitHashTable"\sduring\sinitialization,\swhen\screating\sits\sinternal\sdatastructures.\n\nNow,\show\sto\ssolve\sthis\s?\s(The\s(my)\sgoal\sis\sto\sget\san\s8.4\swhich\sis\snot\sbackward-incompatible).\n\nAlternatives:\n(1)\sRewrite\sthe\smacro\sabove\sto\squery\sthe\sinterp\sabout\sits\sversion\sat\sruntime\sand\sto\sswitch\sbetween\sthe\sdifferent\sentries\sin\sthe\sstubs\stable.\n\n\s\s\s\sAdvantages:\s\s\s\s\sPreserves\scompatibility\sand\sthe\sadditional\ssemantics\sfrom\sthe\smacro.\n\s\s\s\sDisadvantages:\sMore\scomplex,\smaybe\smore\sfragile\stoo.\n\n(2)\sWhat\shappens\swhen\swe\sremove\sthis\smacro\saltogether\s?\sLets\sexplore\sthe\spossibilities:\n\n\s\s\s\s\s-\sBinary\sfor\san\sextension\swhich\swas\scompiled\sagainst\ssome\solder\sstubs\saware\score:\sWill\sjump\sthrough\sthe\sstub\stable\sto\sTcl_InitHashTable\swhich\sin\sturn\swill\ssignal\sTcl_InitHashTableEx\sto\snot\sto\sinitialize\sthe\snew\sfield\sin\sthe\sstructure.\sSensible,\sas\sthe\sold\sextension\swon't\shave\sallocated\sthe\smemory\sfor\sthese.\sThe\smacro\shas\sno\srelevance.\n\n\s\s\s\s\s-\sBinary\sfor\san\sextension\susing\sthe\sextended\sfeatures:\sThis\shas\sto\sbe\scompiled\sagainst\s8.4.,\sand\swill\shave\sto\suse\sTcl_InitHashTableEx\sexplicitly.\sThe\sloss\sof\sthe\smacro\shas\sno\srelevance.\n\n\s\s\s\s\s-\sBinary\sfor\san\sextension\s_not_\susing\sthe\sextended\sfeatures,\sand\swhich\swas\scompiled\sagainst\s8.4.\sWith\sthe\smacro\sthe\score\swill\suse\sTcl_InitHashTableEx\swith\sno\suser-defined\stype\sand\stherefore\sinitialize\sthe\sallocated\sadditional\sfields,\sbut\snot\suse\sthem\s!.\sWithout\sthe\smacro\sthe\sextension\swill\sjump\sTcl_InitHashTable,\stherefore\sthe\sadditional\sfields\sare\snot\sinitialized.\sBut\sthey\sare\sallocated,\shence\sthey\swill\scontain\sgarbage.\sBut\sas\sthe\sextension\sdoes\snot\suse\suser-defined\skeys\sthe\sfields\swon't\sbe\saccessed\seither.\sAt\sleast\sif\sthe\smacro\sTCL_PRESERVE_BINARY_COMPATABILITY\sexists\sduring\scompilation\sof\sthe\score\s(see\sgeneric/tclHash.c).\sIMHO\sit\sshould\sbe\sdefined\sby\sdefault.\sSo\sthe\sgarbage\swill\snot\shurt\sus\s(using\sthe\sassumption\sthat\sthe\spreserve-macro\sis\sdefined).\n\nSo,\swhen\slooking\sat\s(1)\sand\s(2)\sI\sprefer\sthe\slatter.\n
J foundin obsolete:\s8.4a1
J priority 7\sHigh
J resolution None
J status Open
J submitter andreas_kupries
J subsystem 69.\sOther
J title Binary\sincompatibility\sof\s8.4a1\s(Tcl_InitHashTable)
J type Bug
K 223153ffffffffffffffffffffffffffffffffff
U andreas_kupries
Z b0d96358ecb7c143436cc3405438b688