[MLton-devel] allocating space for IntInf primitives

Stephen Weeks MLton@mlton.org
Wed, 23 Oct 2002 14:49:28 -0700


Earlier this year, we changed IntInf primitives that return an IntInf
result so that instead of taking an array in which to store the
result, they took a number of bytes needed, which the limit check pass
inspected to ensure that that amount of space was available at the
frontier.  They then bumped the frontier themselves.

I would like to go back to the old scheme, for two reasons.

* With the generational GC, allocation of arrays (large chunks of
  memory) is no longer as simple.  Large arrays are allocated in the
  old generation, not the nursery.  Currently, IntInfs are allocating
  everything in the nursery -- I think it would be better to mirror
  the allocation of arrays.
* The current implementation complicates space profiling, because more
  pieces of code need to know about how stuff is allocated.

The only problem with the old scheme, IIRC, was that we had problems
with rolling back the frontier if allocation had occurred between the
array allocation and the IntInf primitive.  I propose to solve that
problem by having the rollback check if allocation has occurred, and
if so, to fill in the gap at the end of the array with a bogus object
instead of rolling back.

Thoughts?


-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en

_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel