Dear all,<div><br></div><div>Following on my memory leak problem, I managed to minimise my program.</div><div>And I still don&#39;t understand why it leaks.</div><div><br></div><div>Here is a minimised example:</div><div><br>
</div><div><div>(define prompt1 (make-continuation-prompt-tag &#39;p1))</div><div>(define prompt2 (make-continuation-prompt-tag &#39;p2))</div><div> </div><div>(define (capture-and-abort prompt-tag)</div><div>  (call-with-composable-continuation </div>
<div>   (lambda (k) (abort-current-continuation prompt-tag k))</div><div>      prompt-tag))</div><div> </div><div>(define (test i) </div><div>   (call-with-continuation-prompt </div><div>     (lambda ()</div><div>       (call-with-continuation-prompt</div>
<div>        (lambda()</div><div>          (for ((j i))</div><div>                (capture-and-abort prompt1)</div><div>                (capture-and-abort prompt2)))</div><div>        prompt2))</div><div>       prompt1))</div>
<div>  </div><div>(test 100000)</div></div><div><br></div><div>Calling test with any number 100 000 or higher will allocate memory very fast.</div><div>What is the reason for that and how can I solve this?</div><div><br></div>
<div>Best regards,</div><div><br></div><div>Nicolas.</div><div><br></div>