chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Strange memory leak with lazy-seq


From: Alex Shinn
Subject: Re: [Chicken-users] Strange memory leak with lazy-seq
Date: Tue, 24 Feb 2015 22:15:56 +0900

On Tue, Feb 24, 2015 at 7:17 PM, Moritz Heidkamp <address@hidden> wrote:
Hi Alex,

On 24 February 2015 00:13 CET, Alex Shinn wrote:

> You may be falling short of the issue described by SRFI 45,
> which is that in all known Scheme implementations:
>
>   (define (loop) (delay (force (loop))))
>   (force (loop))
>
> leaks memory.  In R7RS this becomes
>
>   (define (loop) (delay-force (loop)))
>
> which is required by the standard not to leak.
>
> I'm not sure why you don't observe a leak in the
> second example.

Kooda and I discussed this issue on IRC yesterday and in fact, the first
version doesn't leak when compiled either (he mixed up results when
writing this email). So either the CHICKEN compiler is the first Scheme
implementation to not leak memory in this case or something else is
going on :-)

Well, if lazy-seq doesn't actually use delay + force then it's
not an exception :)

I double checked, and for the code I wrote with delay + force,
Chicken leaks both interpreted and compiled.

-- 
Alex


reply via email to

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