Skip to content
Tcl Source Code Artifact [56877ba7f3]
Login

Artifact [56877ba7f3]

Artifact 56877ba7f37e6a5d279023e7152ea78df4f7784ab356eaf6e2d3f99776d94acc:

Ticket change [56877ba7f3] - New ticket [31294d48efe6ead4|31294d48ef] <i>Threaded allocator cannot be disabled in Tcl 9: -DUSE_THREAD_ALLOC=0 and nmake OPTS=tclalloc ignored</i>. by serhiy.storchaka on 2026-10-17 10:51:11.
D 2026-10-17T10:51:11.906
J cmimetype text/x-fossil-wiki
J comment In\sTcl\s9\sthere\sis\sno\sway\sto\sbuild\swithout\sthe\sthreaded\s("zippy")\sallocator,\sother\sthan\s<tt>PURIFY</tt>\sor\s<tt>TCL_MEM_DEBUG</tt>.\sAsking\sfor\sit\sexplicitly\sis\ssilently\signored:\n\n<verbatim>\nCFLAGS="-O2\s-DUSE_THREAD_ALLOC=0"\s../unix/configure\s&&\smake\nnm\stclThreadAlloc.o\s|\sgrep\s'\sT\sTclpAlloc'\s\s\s\s#\sfound:\szippy\sis\scompiled\sin\nnm\stclAlloc.o\s|\sgrep\s'\sT\s'\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s#\sempty\n</verbatim>\n\nExpected:\s<tt>tclThreadAlloc.c</tt>\scompiles\sthe\sstub,\sand\s<tt>TclpAlloc</tt>\scomes\sfrom\s<tt>tclAlloc.c</tt>\s(system\s<tt>malloc()</tt>).\n\nCause:\s<tt>generic/tclInt.h</tt>\shas\n\n<verbatim>\n#if\sTCL_THREADS\s&&\s!defined(USE_THREAD_ALLOC)\n#\s\s\sdefine\sUSE_THREAD_ALLOC\s1\n#endif\n</verbatim>\n\nand\severy\suser\s(<tt>tclInt.h</tt>,\s<tt>tclAlloc.c</tt>,\s<tt>tclThreadAlloc.c</tt>,\s<tt>tclBasic.c</tt>,\s<tt>tclEvent.c</tt>,\s<tt>tclThread.c</tt>,\s<tt>unix/tclUnixThrd.c</tt>,\s<tt>win/tclWinThrd.c</tt>)\stests\s<tt>defined(USE_THREAD_ALLOC)</tt>,\snot\sits\svalue.\sSo\s<tt>-DUSE_THREAD_ALLOC=0</tt>\smeans\s"on",\sand\sleaving\sit\sundefined\salso\smeans\s"on".\sThe\sdefault\swas\sadded\sin\s[f2c996cdb8]\s(2018),\swhen\s<tt>configure</tt>\sstopped\sdefining\s<tt>USE_THREAD_ALLOC=1</tt>.\n\nThe\ssame\sapplies\sto\sthe\sWindows\sbuild:\s<tt>nmake\s-f\smakefile.vc\sOPTS=tclalloc</tt>\ssets\s<tt>USE_THREAD_ALLOC\s=\s0</tt>\sin\s<tt>win/rules.vc</tt>,\sbut\s<tt>/DUSE_THREAD_ALLOC</tt>\sis\spassed\sonly\swhen\s<tt>TCL_VERSION\s&lt;\s87</tt>,\sso\sfor\sTcl\s9\snothing\sreaches\sthe\scompiler\sand\s<tt>tclInt.h</tt>\sturns\sthe\sallocator\son\s(found\sby\sreading\s<tt>rules.vc</tt>,\snot\stested\son\sWindows).\sIn\s8.6\s<tt>OPTS=tclalloc</tt>\sdoes\swork.\n\nIn\s8.6\son\sUnix,\s<tt>configure</tt>\salways\sadds\s<tt>-DUSE_THREAD_ALLOC=1</tt>\sfor\sthreaded\sbuilds,\swhich\sis\sthe\sold\sRFE\s[1079199fff];\sthe\sworkaround\sthere\s(removing\sit\sfrom\s<tt>Makefile</tt>\sand\s<tt>tclConfig.sh</tt>)\sdoes\snot\sapply\sto\s9.x,\swhere\sthere\sis\snothing\sto\sremove.\n\nSeen\swith\s9.0.5\sand\smain\s(9.1).\sPossible\sfix:\sin\s<tt>tclInt.h</tt>,\s<tt>#undef</tt>\s<tt>USE_THREAD_ALLOC</tt>\swhen\sit\sis\sdefined\sas\s0,\sand\slet\s<tt>rules.vc</tt>\spass\s<tt>/DUSE_THREAD_ALLOC=0</tt>\sfor\s<tt>OPTS=tclalloc</tt>.
J foundin 9.0.5,\s9.1.0
J login serhiy.storchaka
J priority 5\sMedium
J resolution None
J severity Minor
J status Open
J subsystem 41.\sMemory\sAllocation
J title Threaded\sallocator\scannot\sbe\sdisabled\sin\sTcl\s9:\s-DUSE_THREAD_ALLOC=0\sand\snmake\sOPTS=tclalloc\signored
J type Bug
K 31294d48efe6ead48dcd44677774b026045d5cb6
U serhiy.storchaka
Z 7e4d8739b4b4e2d600f180b7af2f0f08