Skip to content
Tcl Source Code Artifact [d22aa6b547]
Login

Artifact [d22aa6b547]

Artifact d22aa6b54780e343989c1095e5e05c1109f2f92a:

Ticket change [d22aa6b547] - New ticket [1998273fffffffff|1998273fff] <i>Making a proc arg&#39;s unshared</i>. by ferrieux on 2008-06-19 21:55:13.
D 2008-06-19T21:55:13
J assignee msofer
J cmimetype text/plain
J comment Inside\sa\sproc,\sa\svalue\spassed\sas\sargument\stypically\shas\sa\srefcount\sof\sthree.\sOf\sthe\stwo\sunwanted\sones,\sone\sis\seasily\sremoved:\sthe\slocal\svar\n\n\s\s\s\s\s\s\s\s\sfoo\s$x[unset\sx]\n\nbut\sthe\sother\sis\sharder:\sit\sis\sin\sthe\sCallFrame's\sobjv,\sbasically\s[info\slevel\s0].\n\nThe\sattached\spatch\sprovides\s[info\szaplevel]\swhich\sprematurely\sneutralizes\sthe\s[info\slevel\s0]\sdata\sfor\sthat\spurpose.\sThus,\sin\n\n\s\s\s\s\sproc\spop\sx\s{\n\s\s\s\s\s\s\s\sinfo\szaplevel\n\s\s\s\s\s\s\s\slrange\s$x[unset\sx]\s0\send-1\n\s\s\s\s\s}\n\nThe\s$x\svalue\sis\seffectively\spassed\sunshared,\sprovided\sit\sis\spassed\sunshared\sby\sthe\scaller.\n\nThe\spatch\sworks\sby\sdowning\sthe\srefcounts\sof\sall\smembers\sof\s[info\slevel\s0]\sexcept\sthe\shead\s(to\skeep\sthe\sproc\sname\svisible,\sshould\ssomeone\scall\s[info\slevel\s0]\safter\s[info\szaplevel]),\sand\sreplacing\sthem\swith\sreferences\sto\sa\sshared\sempty\sTcl_Obj.\sHence\san\s[info\slevel\s0]\sof\s"foo\sa\sb\sc"\sbecomes\s"foo\s{}\s{}\s{}".\nThis\sgives\sus\ssafety\sin\sthe\sevent\sof\scallers\scacheing\sCallFrame->objc,objv\sin\slocals/registers.\n
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter ferrieux
J subsystem 10.\sObjects
J title Making\sa\sproc\sarg's\sunshared
J type RFE
K 1998273fffffffffffffffffffffffffffffffff
U ferrieux
Z c061b1cb78e323c8d90565488b9dfc8b