Tcl Source Code

View Ticket
Login
Ticket UUID: 2345638
Title: Tcl_GetMemoryInfo aborts w/threaded memory allocator
Type: Bug Created on: 2008-11-25 19:58:24
Submitter: sdeasey Assigned to: andreas_kupries
Subsystem: 49. Threading Severity:
Priority: 5 Medium Last modified: 2008-11-27 13:47:22
Status: Open Closed by:
Resolution: None Closed on:
Version: obsolete: 8.6a4
Description:
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.
User Comments:
dgp added on 2008-11-27 13:47:22:
See also Bug 2175442