On Tue, Mar 22, 2011 at 8:04 AM, Lassi Tuura <[email protected]> wrote:

> +/* Initialise memory validation method. On linux kernels <2.6.21,
> +   mincore() returns incorrect value for MAP_PRIVATE mappings,
> +   such as stacks. If mincore() was available at compile time,
> +   check if we can actually use it. If not, use msync() instead. */
> +PROTECTED void
> +tdep_init_mem_validate (void)
> +{
> +#ifdef HAVE_MINCORE
> +  unsigned char present;
> +  if (mincore (&present, 1, &present) == 0)
> +    {
> +      Debug(1, "using mincore to validate memory\n");
> +      mem_validate_func = mincore_validate;
> +    }

You might want to write to "present" to improve the chances that
mincore() finds the page in core. Otherwise looks good. Konstantin:
hope this doesn't break FreeBSD.

 -Arun

_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to