Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-11-27
13:47 • Ticket [2345638fff] Tcl_GetMemoryInfo aborts w/threaded memory allocator sta... artifact: d62f287ddc user: dgp
2008-11-25
19:58 • New ticket [2345638fff]. artifact: 32cd08cd88 user: sdeasey

Tcl_GetMemoryInfo aborts w/threaded memory allocator

Open2345638fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-11-25 19:58:24
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.
dgpplain2008-11-27 13:47:22
See also Bug 2175442
Log in (anonymous is fine) to add a comment.