<i>GrowStringBuffer and GrowUnicodeBuffer do not check for overflows</i> status still Open with 3 other changes
by
.
D 2023-05-05T19:41:57.105
J icomment Hi\sAshok,\r\n\r\nAround\s2012/2013,\sI\sdid\ssome\slarger\stests\sand\schanges\sfor\sTcl\s8.5.13\sexperiencing\swith\sdifferent\smallocs\sand\sTcl-internal\smalloc-growing\sstrategies\s(also\strying\sthe\spython\sgrowth\sscheme).\sI\sthink,\swe\sare\sstill\susing\sthis\schanges\sin\sour\s(highly\sbusy)\slive-system\s(ported\sto\s8.6).\sWith\ssmaller\sgrowth\sfactors,\sone\sis\strading\smemory\swaste\svs.\srealloc\sfrequencies,\swhich\sare\smore\sproblematic\son\smulti-threaded\sapplications.\s\r\n\r\nMy\sexperience\swas\sthat\sdoubling\sis\squite\sgood\sup\sto\sa\scertain\ssize,\sbut\sthen,\sthe\spolicy\sshould\sbe\saltered\s(if\sone\sadds\s1\sbyte\sto\sa\s1GB\sstring,\s2GBs\sare\smost\slikely\san\soverkill).\sBy\slooking\sat\sthe\smalloc\simplementations,\sit\smade\salso\ssense\sto\sover-alloc\sin\smultiple\sof\sunits,\swhich\sare\sused\sby\sthe\smalloc\simplementations\sanyhow\s(e.g.\spage\ssizes).\sI\salso\sadded\ssome\smonitoring\scode\s(via\scompile-time\sswitches)\sto\smonitor\slarge\sreallocs.\sI\salso\sremember,\sthat\sthere\swere\sseveral\splaces\sto\stouch\s(such\sas\sDStrings,\sTcl_Objs,\sLists,\s...)\r\n\r\nI\shave\sjust\sa\swrite-up\sof\sthe\smalloc\simplementation\stested\s[1].\sWe\sare\salso\susing\ssince\sa\sfew\syears\sa\ssystem-malloc\spatch,\swhich\smakes\sit\seasier\sto\suse\sdifferent\smalloc\simplementations\sas\sreplacement\sfor\sTcl's\sthreaded\smalloc.\sWe\sstill\suse\sGoogle's\stclmalloc,\salthough,\ssince\sa\sfew\syears,\sthe\sstandard\sLinux\smalloc\sbecame\squite\sgood.\r\n\r\nLet\sme\sknow\sif\syou\sare\sinterested\sin\sthat\scode.\r\n-gustaf\r\n\r\n[1]\shttps://next-scripting.org/2.4.0/doc/misc/thread-mallocs/index1
J login anonymous
J mimetype text/x-markdown
K c9663296fd31fbb2fa1ff1cf019b59f432983516
U anonymous
Z b2dc5b37f62f3c70241706075d9150e4