Re[5]: [Gc] Re: Valgrind patch

Ivan Maidanski ivmai at
Sat Mar 13 00:25:33 PST 2010

Sat, 13 Mar 2010 03:07:18 +0000 письмо от "Boehm, Hans" <hans.boehm at>:

> > Hans -
> > what do you think about using pthread_attr_getstack() in 
> > GC_get_main_stack_base() by default for Linux with threads?
> > 
> I can't immediately think of a problem, though it probably requires some testing across hardware platforms.

Ok. Let it be turned on only if USE_GET_STACKBASE_FOR_MAIN for now.

> Historically, I think the problem with pthread_getattr_np has been that it isn't correctly implemented for single-threaded apps.  Hence we can't consistently rely on it.

Ok. GC is not using pthread.h in the non-threaded case (the opposite would require using -lpthread by the single-threaded clients).

> If you search for pthread_getattr_np in the gmane archives you get a fair amount of ancient history.

In, I see a recommendation to check stackaddr (returned by successful getstack()) for NULL, so I've added it to the code (only for the main thread).

> Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bdwgc-ivmai-239.diff
Type: application/octet-stream
Size: 1254 bytes
Desc: not available
Url :

More information about the Gc mailing list