[racket] Liveliness of variables and GC

From: nicolas.oury at gmail.com (nicolas.oury at gmail.com)
Date: Wed Oct 26 12:27:02 EDT 2011

Dear all,

I am struggling to find the origin of a memory leak in a small program I
wrote.
In order to help me searching, I would like to know a few details on the
implementation of Racket.

1)
(define (f x y)
    (lambda () x))
(define g (f 2 veryBigObject) )

Can I be sure that g does not retain a pointer to veryBigObject?


2) (g is a function)

(define (f)
   (let ([x veryBigObject])
      (g)))

Can I be sure that veryBigObject is not retained by f during the execution
of g?

3) Same program.
g now captures its continuation. Can I be sure that this continuation does
not retain veryBigObject?


Best regards,

Nicolas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111026/b1c26171/attachment.html>

Posted on the users mailing list.