Re: [Gc] Re: Valgrind patch
ivmai at mail.ru
Wed Mar 10 22:16:22 PST 2010
Wed, 10 Mar 2010 20:42:36 -0600 письмо от No Itisnt <theseaisinhere at gmail.com>:
> This new patch uses GC_get_stack_base when linux threads is available.
> So on Linux builds, GC_linux_stack_base now prefers GC_get_stack_base
> -> __libc_stack_end -> /proc/self/stat.
> 2010/3/9 Ludovic CourtХs <ludo at gnu.org>:
> > Hello,
> > Ivan Maidanski <ivmai at mail.ru> writes:
> >> The patch suggests using for GC_linux_stack_base() the same code as in GC_get_stack_base(),
> >> so the simpler fix would be just define GC_get_main_stack_base() to use GC_get_stack_base() for valgreed case.
> >> And, my question is: why are we not using pthread_attr_getstack() for GC_get_main_stack_base() on Linux at present?
> > No idea. I think it would probably make sense to use the same code on
> > all systems based on the GNU libc ( __libc_stack_end & co.), rather
> > than using non-portable code for Linux-based systems. It may even be
> > that pthread_attr_getstack () can just as well be used on GNU systems
> > as you suggest.
> ATTACHMENT: application/x-patch (valgrind2.patch)
Wrong patch (because GC_get_stack_base() should be used only if HAVE_GET_STACK_BASE, and there should be "#else" instead of "#endif"). I understand the logic of your patch but my above question is still in force.
More information about the Gc