Skip to content
Tcl Source Code Artifact [049f5e5503]
Login

Artifact [049f5e5503]

Artifact 049f5e5503e69b0b984d2057f1d6d72e53105d0754b4918b13476b5f5f5052b8:

Ticket change [049f5e5503] - Ticket [f7495f63c01ea800|f7495f63c0] <i>valgrind reports uninitialized memory access running the test suite</i> status still Closed with 5 other changes by apnadkarni on 2026-03-11 02:53:59.
D 2026-03-11T02:53:59.724
J closedate 2461110.6208301387
J closer apnadkarni
J icomment >\sHmmm.\sYou\sare\swrong\shere.\sPadding\salways\sconcerns\strailing\sbytes!\r\n\r\nRead\sthe\sstandard.\sThere\sis\sno\ssuch\srequirement\s**anywhere**.\sThe\sonly\sthing\sthe\sstandard\smandates\sis\smaintaining\sthe\sorder\sof\sfields\sin\sa\sstruct\sand\salignment\sof\sindividual\sfields.\sThe\slocation\sand\slength\sof\spad\sbytes\sis\scompletely\sup\sto\sthe\scompiler\sexcept\sthat\sthe\spadding\scannot\sbe\sat\sthe\sbeginning\sof\sthe\sstruct.\sBut,\sas\sI\ssaid\sI'm\sbeing\spedantic\sand\smay\snot\smatter\sin\spractice.\r\n\r\n>\sSorry,\swrong\sagain.\sOn\sa\s64-bit\splatform,\swhich\srequires\s64-bit\svalues\sto\sbe\sproperly\saligned,\sall\smallocs\sare\saligned\son\s8-byte\sboundaries.\r\n\r\nYour\sreference\sto\smalloc\sindicates\syou\ssimply\sdid\snot\sunderstand\sthe\sissue.\sIt\shas\snothing\sto\sdo\swith\sallocation\sstrategy.\sIt's\sa\s**compiler**\sexpectation\sthat\s(ScriptLimitCallbackKey\s*)\swill\spoint\sto\sa\slocation\swith\ssizeof(ScriptLimitCallbackKey)\svalid\sbytes,\sno\smatter\show\sthey\swere\sallocated,\sdynamically\svia\smalloc,\son\sthe\sstack,\sor\sstatic\sstorage.\sWhat\syour\scode\sis\sdoing\sis\sthe\sequivalent\sof\sthis:\r\n\r\n```\r\nchar\sbuffer[sizeof(ScriptLimitCallbackKey)-sizeof(int)];\r\nScriptLimitCallbackKey\s*key\s=\s(ScriptLimitCallbackKey\s*)buf;\r\n```\r\n\r\nAnd\swith\sregards\sto\saccessing\s32-bits\sversus\s64-bits,\scost\sof\smemory\sand\sregistry\soperations\sis\sstill\sthe\ssame\son\s64-bit\splatforms.\sAnd\sif\syou\sthink\sadding\sone\sless\sinteger\sis\san\s"optimization"\sfor\sTcl\sperformance,\sI\sdon't\sknow\swhat\sto\ssay!\r\n\r\nIn\sany\scase,\sdo\sas\syou\swish.\sI'm\snot\sgoing\sto\scomment\sfurther.
J login apnadkarni
J mimetype text/x-markdown
K f7495f63c01ea80069198ac183e1e0cc8873dabe
U apnadkarni
Z c5c5be15395c56904f50ca0d1f1220ae