[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stream-filter and space leaks
>>>>> "RK" == Richard Kelsey <kelsey@xxxxxxx> writes:
RK> From: Phil Bewig <pbewig@xxxxxxxxxx>
RK> Date: Thu, 20 Feb 2003 15:08:05 +0100
RK> Stream-filter and
RK> the various stream-drop functions leak space if they are not implemented
RK> properly, something that is hard to do. In fact, in a private e-mail
RK> yesterday someone pointed out another space leak involving stream-filter
RK> (they were also kind enough to show how to fix it).
RK> Comparing the new version of STREAM-FILTER with the one in the proposed SRFI,
RK> it appears that this latest space leak could be fixed by including your own
RK> versions of DELAY and FORCE in the sample implementation, using one where forcing
RK> a stream caused it to stop retaining the generating thunk. You could merge this
RK> delay into the STREAM record:
The code you posted seems to be essentially the definition of
DELAY/FORCE from Scheme 48. However, Phil's old code does leak in
Scheme 48 and doesn't leak with the proposed fix. This is just a
note---I intend to check next week why this is so.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla