[MLton] callcc and space use

Vesa Karvonen vesa.a.j.k at gmail.com
Wed Feb 6 15:57:13 PST 2008


On Feb 6, 2008 8:49 PM, Daniel Spoonhower <spoons at cs.cmu.edu> wrote:
> After some investigation, I think I have an answer to my problem.  In
> the end, it seems the problem had nothing to do with callcc, but with
> part of the analysis used in the reference flattening optimization
> (http://mlton.org/RefFlatten).
[...]

Interestingly, the patch eliminates the space leak from the two test
cases you gave earlier, but does not remove it from a modified version
of your second test case.  The modified version uses threads rather
than continuations.  I wrote it (back when you sent the test cases) to
see whether or not continuations make it simpler or not (IMO, they do
not; the version using threads is simpler, IMO).  (The modified
version has been intentionally kept close to the original to reduce
diffs.)  See the attachment.  At any rate, the space leak definitely
seems to be caused by a bug in MLton.  I do not know enough about
RefFlatten to comment on your patch.  Perhaps RefFlatten is still not
conservative enough.

-Vesa Karvonen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple2-threads.sml
Type: application/smil
Size: 1664 bytes
Desc: not available
Url : http://mlton.org/pipermail/mlton/attachments/20080207/eaed10fb/simple2-threads.smil


More information about the MLton mailing list