chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] srfi-40 space leak?


From: Dan
Subject: [Chicken-users] srfi-40 space leak?
Date: Mon, 10 Apr 2006 08:13:41 -0700 (PDT)

Hi all,

After reading the SRFI-40 (stream library) egg
documentation at

http://www.call-with-current-continuation.org/eggs/srfi-40.html

I thought that the implementation includes the srfi-45
fixes to avoid space leaks. However, the test program
below seems to take up an ever-increasing amount of
memory. What gives?

---

;; Compile with csc -O3 -R srfi-40 test.scm
;; You may need to install srfi-40:
;; chicken-setup srfi-40

(define stream-ref
  (lambda (s n)
    (let loop ((s s) (i 0))
      (if (= i n) (stream-car s)
          (loop (stream-cdr s) (+ i 1))))))

(define integers-from
  (lambda (n)
    (stream-cons n (integers-from (+ n 1)))))
(define integers (integers-from 0))

; (set-gc-report! #t)
(display
  (stream-ref
    (stream-filter even? integers) 5000000))
(newline)

-- Dan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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