[Gc] Re: Valgrind patch
ludo at gnu.org
Tue Mar 9 15:24:36 PST 2010
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.
At any rate, parsing Linux’ /proc is inefficient and fragile (what if
/proc isn’t mounted? what if the format of ‘maps’ changes?).
More information about the Gc