Boost logo

Boost Users :

From: pete_at_[hidden]
Date: 2007-01-21 19:36:25


On Sun, Jan 21, 2007 at 07:17:42PM +0100, Roland Schwarz wrote:
> You might try the below code snippet, which gives me the same valgrind
> report than the example using Boost.Thread:
>
> #include <pthread.h>
>
> void* fn(void* p)
> {
> return NULL;
> }
>
> int main()
> {
> pthread_t th;
> pthread_create(&th, NULL, fn, NULL);
> pthread_join(th, NULL);
> return 0;
> }
>

I noticed with the straight pthread code that if I compiled it as ANSI
C, the leak was smaller. It sure seems like this should be a well known
issue.

Here is the ANSI C (gcc) valgrind report:

==5584== LEAK SUMMARY:
==5584== definitely lost: 0 bytes in 0 blocks.
==5584== possibly lost: 136 bytes in 1 blocks.
==5584== still reachable: 0 bytes in 0 blocks.
==5584== suppressed: 0 bytes in 0 blocks.

Here is the same code but compiled with C++ (g++):

==5568== LEAK SUMMARY:
==5568== definitely lost: 0 bytes in 0 blocks.
==5568== possibly lost: 144 bytes in 1 blocks.
==5568== still reachable: 0 bytes in 0 blocks.

Thanks, I guess it's not a boost issue at all.

Pete

> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net