D 2026-04-13T07:07:35.114
J icomment Bisect\spoints\sto\s[42764583](https://core.tcl-lang.org/tcl/info/427645831a).\sThe\schange\sto\susing\s`Tcl_ExternalToUtfDStringEx`\sloses\sdynamic\smemory\salready\sallocated\sto\sthe\spassed\s`Tcl_DString`\s(it\sassumes\sit\sis\suninitialized\sand\soverwrites\sthe\sfields).\sI\sthink\sthe\soriginal\scode\swas\soptimized\sto\snot\srequire\sreallocation\sof\smemory\sfor\severy\sfile\sin\sa\szip\sfor\slong\spathnames.\r\n\r\nPossible\ssolutions\sare\r\n\r\n1.\sRevert\sabove\scommit\sbut\sI'm\sunclear\sas\sto\swhether\sthe\scommit\swas\sprimarily\scode\sreduction\sor\salso\sa\sbug\sfix.\r\n\r\n2.\sCall\s`Tcl_DStringFree`\sbefore\sthe\scall\sto\s`Tcl_ExternalToUtfDStringEx`\swhich\swould\sbe\s(potentially)\sa\sperformance\shit\srequiring\snew\smemory\sfree/allocation\son\severy\szipfs\sentry\s(when\spaths\sexceeded\s`Tcl_DString`\sstatic\ssize).\r\n\r\n3.\sModify\s`Tcl_ExternalToUtfDStringEx`\sto\saccept\sa\sflag\swhen\sthe\soutput\s`Tcl_DString`\shas\salready\sbeen\sinitialized.\sBut\srequires\sa\sTIP.
J login apnadkarni
J mimetype text/x-markdown
K 275db3d98511dbc2bb50109c3e4fe7501dff9896
U apnadkarni
Z ee37d1ff3fafc5a154f30c3288dc5287