<i>Bignum documentation needs to be clarified w.r.t mp_int handling</i> status still Open with 3 other changes
by
.
D 2026-01-12T03:39:06.632
J icomment Thanks\sfor\sflagging\sthis.\sMaking\sthe\sownership/lifetime\scontract\sfor\smp_int\sexplicit\sis\simportant\sto\sprevent\sleaks\sand\saccidental\smisuse.\r\n\r\nI\sagree\sthe\sdocs\sshould\sbe\sstrict\shere.\sI\swill\scross-check\sthe\scurrent\simplementation\s(including\sTcl_TakeBignumFromObj\sbehaviour\sfor\sshared\svs\sunshared\sobjects)\sand\sthen\spropose\sa\sdocumentation\spatch.\r\n\r\nProposed\sdoc\sclarifications\s(subject\sto\sconfirming\sthe\simplementation):\r\n\r\n-\sTcl_SetBignumObj:\sclarify\swhether\sthe\sfunction\sclears/consumes\sthe\ssupplied\smp_int\s(i.e.,\scallers\smust\streat\sit\sas\scleared\sand\snot\srely\son\sits\sprior\svalue\safter\sthe\scall).\r\n\r\n-\sTcl_GetBignumFromObj\s/\sTcl_TakeBignumFromObj:\sclarify\swhether\sthe\scaller\smust\scall\smp_clear\son\sthe\smp_int\sthey\sreceive/populate\sto\srelease\sinternal\sallocations,\sand\swhat\spostconditions\sapply\sto\sthe\ssource\sobject\sin\sthe\sTake\scase.\r\n\r\nI\scan\salso\sadd\sa\sminimal\scode\ssnippet\sillustrating\sthe\scorrect\scleanup\spattern.
J login cdubois
J mimetype text/plain
K 07000bd237c021d5bf7bcc721a6ab3570ecc4f08
U cdubois
Z 9c8d0b44a8d8930c64ade4f46434ca4f