Hi Manolis,

manolis...@gmail.com writes:

> From: Manolis Ragkousis <manolis...@gmail.com>
>
> On Hurd, because madvise() is not implemented we disable it.
>
> * libguile/vm.c (return_unused_stack_to_os): Don't use madvise() on Hurd.
> ---
>  libguile/vm.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libguile/vm.c b/libguile/vm.c
> index 18f219249..7089f23c7 100644
> --- a/libguile/vm.c
> +++ b/libguile/vm.c
> @@ -896,6 +896,8 @@ return_unused_stack_to_os (struct scm_vm *vp)
>  
>    /* Return these pages to the OS.  The next time they are paged in,
>       they will be zeroed.  */
> +#if !defined __gnu_hurd__
> +  /* madvise() is not implemented on GNU Hurd. */
>    if (lo < hi)
>      {
>        int ret = 0;
> @@ -907,7 +909,7 @@ return_unused_stack_to_os (struct scm_vm *vp)
>        if (ret)
>          perror ("madvise failed");
>      }
> -
> +#endif
>    vp->sp_min_since_gc = vp->sp;
>  #endif
>  }

Is there a test we could perform at run-time to discover whether
madvise() is implemented?  If so, that would be greatly preferable.

I assume that madvise() will be implemented in the Hurd at some point.
When that happens, we'll want to implement a run-time test in Guile,
because this is important functionality for Guile users that we will
want to use as soon as it becomes available, but in practice there will
continue to be some users who run an old version of the Hurd.

Since we can already foresee wanting to implement the run-time test in
the future, we might as well do it now, which would have an added
benefit: it would mean that when the Hurd gains madvise() support,
existing versions of Guile will immediately be able to use it.

What do you think?

    Regards,
      Mark

Reply via email to