Skip to content
Tcl Source Code Artifact [84380bd2c1]
Login

Artifact [84380bd2c1]

Artifact 84380bd2c1c5793a43090ba913f5fcbe9885a5af:

Ticket change [84380bd2c1] - New ticket [219316ffffffffff|219316ffff] <i>Garbage collection of object oriented Tcl commands</i>. by nobody on 2000-10-26 05:10:37.
D 2000-10-26T05:10:37
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s3678\sRFE\nVersion:\s8.2.1\nSubmitDate:\s'1999-11-23'\nLastModified:\s'2000-04-03'\nSeverity:\sLOW\nStatus:\sUnAssn\nSubmitter:\stechsupp\nChangedBy:\shobbs\nOS:\sAll\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-10-25'\n\n\nName:\nChris\sOliver\n\nDesiredBehavior:\nSeveral\spackages\ssuch\sas\sTclBlend\sand\sTclMico\simplement\sa\sform\sof\nautomatic\sgarbage\scollection\sfor\sTcl\scommands\sthat\srepresent\sobject\ninstances\s(Java\sand\sCORBA\srespectively).\s\sHowever\sthey\sdo\sthis\swith\sa\nrather\sgross\shack,\snamely\sby\soverwriting\sthe\sglobal\s"cmdName"\sTcl\nObjType\swith\stheir\sown\simplementation.\sThe\sreplacement\simplementation\ndeletes\ssuch\sa\scommand\sfrom\sthe\sinterpreter\swhen\sthe\sthe\slast\sTcl_Obj\nthat\sreferences\sit\sis\sdestroyed.\n\nA\scouple\sof\sminor\schanges\sto\sthe\sTcl\score\swould\sallow\sthese\sand\sother\nobject\soriented\sTcl\sextensions\sto\sprovide\sthe\sconvenience\sof\sautomatic\ngarbage\scollection\sto\sthe\sscript\swriter,\swithout\sresorting\sto\ssuch\nhacking.\s\sI\swill\sdescribe\sthese\schanges\sin\sterms\sof\sa\spossible\nimplementation,\showever\sother\sways\sof\sachieving\sthe\ssame\sresult\sare\npossible:\n\n1.\sAdd\sthe\sfollowing\snew\sinterface:\n\n\s\s\s\sTclCommand\sTcl_CreateObjCommandEx(Tcl_Interp\s*\sinterp,\schar\s*\ncmdName,\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sTcl_ObjCmdProc\s*\sproc,\sClientData\sclientData,\nTcl_CmdDeleteProc\s*\sdeleteProc,\s/*\sboolean*/\sint\scollectMe);\n\n2.\sAdd\sa\scorresponding\sfield\sto\sstruct\sCommand:\n\s\s\s\sstruct\sCommand\s{\n\s\s\s\s\s\s\s\s...\n\s\s\s\s\s\s\s\sint\scollectMe;\n\s\s\s\s};\n\nTcl_CreateObjCommandEx\suses\sthe\scurrent\simplementation\sof\nTcl_CreateObjCommand\sbut\salso\sassigns\sthe\svalue\sof\sits\scollectMe\nparameter\sto\sthe\scollectMe\sfield\sof\sthe\screated\sstruct\sCommand.\n\nTcl_CreateObjCommand\scan\sbe\sreimplemented\sas\n\n\s\s\s\sTcl_CreateObjCommandEx(interp,\scmdName,\sproc,\sclientData,\ndeleteProc,\s0);\n\n3.\sModify\s`tclExecute.c`FreeCmdNameInternalRep\sto\scheck\sthe\sreference\ncount\sof\sthe\sCommand\sstruct\sit\spoints\sat;\sif\sit\sis\sabout\sto\sreach\sone\n(i.e.\sthe\sonly\sreference\swill\sbe\sthat\sof\sthe\sNamespace\shash\stable)\sand\nits\scollectMe\sfield\sis\snon-zero,\sthen\scall\sTcl_DeleteCommandFromToken\son\nthe\sCommand\spointer.\n\nAt\sany\srate,\sthe\sbasic\sidea\sis\sthat\sTcl\swould\sask\sthe\scommand's\nimplementation\sif\sit\swants\sto\stake\saction\swhen\sthere\sare\sno\sfurther\nreferences\sto\sit.\n\nComments?\n\n\n\n
J foundin obsolete:\s8.2.1
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 10.\sObjects
J title Garbage\scollection\sof\sobject\soriented\sTcl\scommands
J type RFE
K 219316ffffffffffffffffffffffffffffffffff
U nobody
Z 113a785c949136db501540cf7aebf57b