[racket] Memory and delimited continuations

From: nicolas.oury at gmail.com (nicolas.oury at gmail.com)
Date: Thu Oct 27 14:57:57 EDT 2011

Dear all,

Following on my memory leak problem, I managed to minimise my program.
And I still don't understand why it leaks.

Here is a minimised example:

(define prompt1 (make-continuation-prompt-tag 'p1))
(define prompt2 (make-continuation-prompt-tag 'p2))

(define (capture-and-abort prompt-tag)
   (lambda (k) (abort-current-continuation prompt-tag k))

(define (test i)
     (lambda ()
          (for ((j i))
                (capture-and-abort prompt1)
                (capture-and-abort prompt2)))

(test 100000)

Calling test with any number 100 000 or higher will allocate memory very
What is the reason for that and how can I solve this?

Best regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111027/5c16267c/attachment.html>

Posted on the users mailing list.