[boost-thread] memory leak (according to Boost.Test)

This little program, compiled on VC++ 8.0 leaks memory, apparently.
#define BOOST_AUTO_TEST_MAIN
#include

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of n.torrey.pines@gmail.com
Can anyone using VC++ 8.0 and the release version of Boost confirm this? With Google, I found some past references to Boost.Thread leaking memory.
I can confirm that memory is not freed, however I don't think it's a leak. If you make 10 threads or 1 thread, it's the same amount of memory that goes without deallocation. Sohail

On 3/6/07, Sohail Somani
If you make 10 threads or 1 thread, it's the same amount of memory that goes without deallocation.
That appears to be correct. I wonder though why Boost.Thread needs to leak memory at all: was that a choice or an oversight? Those test messages look bad. If I were to distribute a test suite with my software, I'd have to tell the user to take it easy and make sure only 32 bytes got leaked.

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of n.torrey.pines@gmail.com
On 3/6/07, Sohail Somani
wrote: If you make 10 threads or 1 thread, it's the same amount of memory that goes without deallocation.
That appears to be correct. I wonder though why Boost.Thread needs to leak memory at all: was that a choice or an oversight?
Those test messages look bad. If I were to distribute a test suite with my software, I'd have to tell the user to take it easy and make sure only 32 bytes got leaked.
You'd have to find the source of that specific message to be sure. I think its to do with some singleton used in the Windows version of Boost.Thread.

n.torrey.pines@gmail.com wrote:
On 3/6/07, Sohail Somani
wrote: If you make 10 threads or 1 thread, it's the same amount of memory that goes without deallocation.
That appears to be correct. I wonder though why Boost.Thread needs to leak memory at all: was that a choice or an oversight?
Choice. I was able to avoid the allocation in this specific case: http://boost.cvs.sourceforge.net/boost/boost/libs/thread/src/tss_hooks.cpp?revision=1.4&view=markup but in general, objects that need to have program lifetime cannot be deleted safely. Many industrial-grade leak checkers will not report such objects as leaks, because they aren't.
participants (3)
-
n.torrey.pines@gmail.com
-
Peter Dimov
-
Sohail Somani