[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] On Hurd, don't use not implemented madvise()

From: Mark H Weaver
Subject: Re: [PATCH] On Hurd, don't use not implemented madvise()
Date: Tue, 30 May 2017 15:41:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hi Manolis,

address@hidden writes:

> From: Manolis Ragkousis <address@hidden>
> 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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]