guile-devel
[Top][All Lists]
Advanced

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

Re: port-for-each vs lazy sweep


From: Ludovic Courtès
Subject: Re: port-for-each vs lazy sweep
Date: Thu, 23 Aug 2007 09:25:09 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi,

Kevin Ryde <address@hidden> writes:

> Actually I see the flush func of a soft port is entirely unused, it's
> never called by a force-output because nothing is ever put in the port
> buffer as such.  The manual could be clearer about what it's supposed to
> be for :-(.

Maybe that's a bug, maybe it was meant to be called.  We could fix this
in HEAD, but maybe not in 1.8, in case programs rely on it.

> At any rate, I put in the failing test below for port-for-each, and I
> think flush-all could benefit from the rewrite below, just on general
> principles.

I agree with the latter.

> +(with-test-prefix "port-for-each"
> +
> +  ;; In guile 1.8.0 through 1.8.2, port-for-each could pass a freed cell to
> +  ;; its iterator func if a port was inaccessible in the last gc mark but
> +  ;; the lazy sweeping has not yet reached it to remove it from the port
> +  ;; table (scm_i_port_table).  Provoking those gc conditions is a little
> +  ;; tricky, but the following code made it happen in 1.8.2.
> +  (pass-if "passing freed cell"
> +    (throw 'unresolved)

The above line should be removed.  :-)

Once this line is removed, the test fails consistently here (HEAD),
which is good news I suppose.

> +      (open-input-file "/dev/null")

`(%make-void-port "r")' would have the same effect but would be more
portable.

Thanks,
Ludovic.





reply via email to

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