D 2008-10-24T22:02:19
J icomment Are\syou\ssure\syou\shave\sthe\sright\sculprit\shere?\s\sWhat\syou\ndescribe\ssounds\slike\sa\sbug\sin\sElectricFence\sor\smaybe\nsomewhere\selse.\n\n>\sTcl's\sTcl_Alloc()\sroutine\s(and\sthe\sckalloc()\sform)\sis\n>\sdocumented\sto\sreturn\sa\spointer\saligned\sfor\sany\spurpose.\n\nThis\sis\sthe\ssame\sguarantee\sthat\smalloc\sgives.\s\sI\schecked\sthe\nC\sstandard\sas\swell\sas\smy\slocal\sman\spages\s(on\sMac\sOS\sX)\sabout\nthis.\s\sSee\salso\n<http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html>.\n\n>\sUnfortunately,\swhen\smalloc()\sreturns\sa\spointer\sthat\sis\n>\smisaligned\sfor\ssome\spurposes\s(notably\sfor\sholding\sa\n>\spointer\svalue)\n\nThat\simplementation\sof\smalloc\swould\sbe\sbroken.\n\nNote\sthat\sthere\sare\sno\ssimple\sfunctions\sin\sstandard\sC\sthat\ncan\sbe\sused\sto\sensure\salignment\sand\sthat\sa\sportable\nimplementation\sto\sdo\sthis\sis\snon-trivial\s(from\sthe\sPOV\sof\nthe\srather\sgeneric\sC\sstandard\sat\sleast).\s\sA\smalloc\sthat\sdoes\nnot\sensure\salignment\swould\sbe\sunreasonable\sor\seven\suseless.\n\n
J login cc_benny
J mimetype text/plain
J username cc_benny
K 2184717fffffffffffffffffffffffffffffffff
U cc_benny
Z c6667f2477900f08e4bc524cdea7843e