Skip to content
Tcl Source Code Artifact [619a5edacc]
Login

Artifact [619a5edacc]

Artifact 619a5edaccad1bafd3e05163d4cb3a2f8318538b539b3829456380aa90dcaad7:

Ticket change [619a5edacc] - Ticket [8dd2807066d7cc4d|8dd2807066] <i>bug in single-argument &#39;max&#39; with bignums</i> status still Pending with 3 other changes by sebres on 2025-11-11 12:10:32.
D 2025-11-11T12:10:32.805
J icomment <blockquote>>\sLet's\sdiscuss\sthe\schanges\sin\sTcl_TakeBignumFromObj()\sfurther.</blockquote>\r\n\r\nAgree.\r\n\r\n<blockquote>>\sI\sstill\sprefer\sto\ssimply\sreplace\sTake\swith\sGet\sinstead\sand\snot\srequire\sany\schanges\sat\sthe\scall\ssite\sin\s`ExprMaxMinFunc`.</blockquote>\r\n\r\nIt'd\sbe\sunneeded\sif\sJan\shad\smerged\sthe\swhole\sfix\sof\sme,\sbut...\r\n\r\n<blockquote>>\sA\snew\sbignum\shas\sto\sbe\screated\sin\seither\scase.</blockquote>\r\n\r\nWell,\sI\sthink\sthis\sis\sexactly\sthat,\swhat\sJan\strying\sto\sachieve\sor\srather\sto\sassume\swith\s"the\scurrent\simplementation\smakes\ssense"\s-\sthe\shope\sis\sthat\sbignum\scan\sbe\smoved\sfrom\sobject\sto\sbignumValue\spointer\sif\sit\sis\sunshared\s(so\sit'd\sbe\snot\screated)...\sBut,\sIMHO\sit\sis\snot\scorrect\s-\seven\swith\srefCounts\s1\s(or\s0),\sone\scan't\sguarantee\sthat\sthe\sobject\swill\sbe\sunused\shereafter\s(or\sas\sJan\swrote\s"Tcl_TakeBignumFromObj()\sshould\sonly\sbe\sused\swhen\sthe\sTcl_Obj\sis\sTcl_DecrRefCount'ed\simmediately").\sSo,\sIMHO,\sit\sis\snot\scorrect\sto\srely\son\srefCounts\sin\spublic\sfunction\s(however\sI'm\sOK\sif\sit'd\shappen\salways\sand\spanic\sif\sshared).\s\r\n\r\nJust\sit\sis\soften\sthe\scase\sthat\sthe\sobjects\ssupplied\sto\s<code>tcl::mathfunc::*</code>\sare\sshared\s(via\sarguments\setc),\sso\swould\sbe\scopied\sthen.\r\n\r\nIn\sany\scase,\sI\sdon't\sunderstand\swhy\swe\scan\snot\suse\sthe\svalue\sof\s<code>objPtr->internalRep.wideValue</code>\sdirectly\sfor\sthe\scomparison\s-\sshimmer\sis\sunexpected\sthere,\sand\sthe\scopy\son\sread\saccess\sis\sa\sbit\sunexpected\sto\sme\stherefore.
J login sebres
J mimetype text/x-fossil-wiki
K 8dd2807066d7cc4d8604164f39b7f0d65c0dc321
U sebres
Z fa49daad84fdf61beebdf9bc18aa977b