<i>new macro TclFreeIfRefCountZero</i> status still Open with 4 other changes
by
.
D 2012-12-31T09:47:14
J icomment Consider:\n\n\s\sTcl_SetObjResult(interp,\sTcl_NewIntObj(123));\n\nThat\swould\shave\sto\sbecome:\n\n\s\sTcl_Obj\s*resultObj\s=\sTcl_NewIntObj(123);\n\s\sTcl_SetObjResult(interp,\sresultObj);\n\s\sTcl_DecrRefCount(resultObj);\n\nThere\sare\sa\s*lot*\sof\sother\s"simple"\scases\slike\sthat\s(e.g.,\sappending\san\selement\sto\sa\sknown\slist)\sand\sthe\sidiom\sis\svery\scommon\sin\sTcl\sitself.\s(For\sexample,\sit\sis\sthere\sin\sall\sof\sthe\serror\shandling.)\sDictionary\sconstruction\sis\seven\sworse.\n\nThe\scases\sthat\sget\sslightly\sbetter\sare\sthose\swhere\sfailures\sare\spossible\sin\sthe\s"consuming"\soperation\s(such\sas\sTcl_SetVar2Ex)\sbut\sthey\sjust\sgain\sthe\sability\sto\somit\sthe\sTcl_IncrRefCount\sfrom\sthe\sexplicit\spattern;\sthey\sstill\shave\sall\sthe\scomplexity\sof\sdealing\swith\sthe\sgory\sdetails.\n\nIt\salso\sbreaks\scode\sa\slot.\s(This\sis\sfrom\smemory/experience;\sI\swrote\san\sOO\sextension\s—\sit\swas\sfast\sbut\shard\sto\suse\s—\sagainst\s8.0a1\sand\smaintained\sit\sthrough\sto\s8.0.3\sor\sso.\sThe\spain\sfrom\sswitching\sover\swas\shigh,\sbut\sthe\scode\sshortened\squite\sa\slot.)\sCode\swritten\sfor\sone\spattern\scannot\sbe\sconverted\sto\sthe\sother\sby\smacro.\sYes,\swe've\sagreed\sto\slook\sat\sbreaking\sthings\swhere\snecessary,\sbut\sthis\sis\sa\slot\sof\sbreakage\sfor\svery\squestionable\sgain.\n
J login dkf
J mimetype text/plain
J username dkf
K 3598875fffffffffffffffffffffffffffffffff
U dkf
Z ebb84c19549619022a71b3dd8cbd73fc