With Tcl from HEAD compiled:
--enable-threads --enable-symbols=mem
on a modern 32bit Linux, a program (naviserver) linked with that Tcl aborts with this message:
Tcl_GetMemoryInfo called when threaded memory allocator not in use
Yet the tclConfig.sh contains:
-DTCL_THREADS=1
-DUSE_THREAD_ALLOC=1
And the symbol USE_THREAD_ALLOC, which this feature depends on, seems to be unconditionally defined when --enable-threads is specified.
Is the threaded allocator actually enabled when --enable-threads is specified (this used to be the case), or is Tcl_GetMemoryInfo mistaken?
What is the correct way to figure out whether I can call Tcl_GetMemoryInfo from an application?
Also, it would be nice to have a configure switch for the memory allocator:
--enable-thread-allocator
You could default it to on if --enable-threads is specified, as used to be the case, but you may want to default this to off considering that OS allocators perform better with threads than they used to and for the typical threaded desktop app are likely to use much less memory than the Tcl allocator.
|