[MLton-devel] heap frontier movement while in C code

Stephen Weeks MLton@MLton.org
Wed, 2 Apr 2003 17:30:58 -0800


> I'm  sorry  that this is coming so late, but I'm confused about the notion of
> the C interface changing so that the heap frontier can move around.   Doesn't
> this  keep  the  bignum  code from being able to roll back the heap?  That is
> pretty important since without it we will have to zero out the holes  created
> in the heap and will also cause GC's to occur more frequently.
> 
> Am  I  missing  something  obvious?   I understand that the ability of having
> call-backs is very good.

I think you are confused about the effect of the change.

Previously, we had assumed that calls to functions declared via _ffi
could not change the SML frontier.  That assumption was expressed in
how backend/ssa-to-rssa.fun built a CFunction when translating a call
to an FFI.  This has nothing to do with how primitives like IntInf_add
are implemented, which happens to be by calling a CFunction.  For
those primitives, the CFunction already knew that the function could
modify the frontier.

With the new callback mechanism, the only change has been to assume
that functions declared via _ffi can change the frontier (if the
program uses callbacks).  This does not have any effect on bignum
code.



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel