Skip to content
Tcl Source Code Artifact [b3048b0445]
Login

Artifact [b3048b0445]

Artifact b3048b044566a4f8aff866b55f049fcc419a18c8:

Ticket change [b3048b0445] - Ticket [752814ffffffffff|752814ffff] <i>Regexp change Tcl_Obj type to string</i> status still Open with 4 other changes by ysutjandra on 2003-06-12 05:20:52.
D 2003-06-12T05:20:52
J icomment Logged\sIn:\sYES\s\nuser_id=799156\n\nI'm\ssorry\sI\ssaid\sthe\swrong\sthing.\n\nI\ssaid..\n\s\s\sAt\sthe\svery\sleast,\sit\sshould\scheck\swhether\sthe\sTcl_Obj\sis\s\n\s\s\sshared\sor\snot,\sand\screate\sa\sutf-8\sstring\sobject\son\sa\snew\s\n\s\s\sTcl_obj.\n\nI\smeant\sto\ssay,\n\n\s\s\sAt\sthe\svery\sleast,\sit\sshould\scheck\swhether\sthe\sTcl_Obj\sis\s\n\s\s\sshared\sor\snot,\sand\screate\sa\sunicode\sstring\sobject\son\sa\snew\s\n\s\s\sTcl_obj.\n\n\nI\sguess\sit's\sfine\sif\sit's\sa\srequirement\sthat\sregexp\swill\schange\s\nany\sobject\stype\sto\sa\sstring.\s\sI\sunderstand\sfrom\syour\s\nexplanation\sthat\sthe\sregexp\shas\sto\soperate\son\san\sobject\swith\s\nunicode\stype,\sleading\sto\sconverting\sthe\sold\srepresentation\s(of\s\nthe\stype\sI\sregistered)\sto\sthe\sunicode\srepresentation\sand\sleads\s\nto\sfreeing\sthe\sold\srepresentation.\s\s\n\n\nI\sam\strying\sto\smake\suse\sof\sTcl\smemory\smanagement\son\s\nTcl_Obj\sby\sregistering\smy\sown\sobject\stype\sso\sthat\sit\swill\scall\s\nthe\sregistered\sfree\sfunction\sonce\sit\sknows\sthe\sobject\sis\snot\s\nneeded\sanymore.\n\nIn\sother\swords,\sI\sregistered\sa\snew\sobject-type,\sand\sI\swant\s\nthe\sTcl_Obj\sthat\sholds\smy\sobject\sto\sstay\sas\sis\sthroughout\sits\s\nlifespan.\s\sie.\sit\swill\sonly\scall\sthe\sfree\sfunction\swhen\sthe\s\nrefCount\sis\szero.\n\nNow\sI\swant\sto\sstop\susers\sfrom\sexecuting\scommands\sthat\swill\s\nconvert\sthe\sobject\sof\smy\stype\sto\ssomething\selse.\s\sProbably\s\nsomething\slike:\n\n\s\s\sset\sa\s[newMyType]\n\s\s\sregexp\s{hello}\s$a\n\s\s\s-->\sIllegal\soperation\son\svariable\sa,\s\n\s\s\s-->\sconverting\s'MyType'\sto\s'string'\sis\sprohibited\n\n\s\s\sincr\sa\n\s\s\s-->\sIllegal\soperation\son\svariable\sa,\n\s\s\s-->\sconverting\s'MyType'\sto\s'int'\sis\sprohibited\n\nCurrently,\sI\sknow\sonly\show\sto\sdetect\sthis\sby\simplementing\sa\s\nfree\sfunction\sthat\sdetects\swhether\sthe\srefCount\sis\salready\s\nzero\sor\snot.\s\sBut\sthis\sfunction\sreturns\svoid\sand\sI\scannot\sstop\s\nthe\susers\sfrom\sdoing\sthis.\n\nI'm\sokay\sif\sthere\sis\sa\sway\sto\sprevent\susers\sfrom\susing\ssuch\s\ncommands\son\smy\sobj.\s\sIs\sthere\sa\sway\sto\sreturn\san\serror\sat\sa\s\nsituation\slike\sthis\snow.\n\n\n
J login ysutjandra
J mimetype text/plain
J username ysutjandra
K 752814ffffffffffffffffffffffffffffffffff
U ysutjandra
Z 8d34ec7c6e2a7c30fc742a778bce1161