[MLton-devel] mlton/runtime GC_world.c,1.4,1.5 gc.c,1.43,1.44 gc.h,1.21,1.22

Henry Cejtin henry@sourcelight.com
Tue, 23 Apr 2002 22:48:00 -0500


I'm curious why live, the second arg to computeSemiSize() is a W64 instead of
a uint.  (Any calculations in the function need to be done using  W64's,  but
the input seems like it must always fit.)

I  still  find  the  comments  before  computeSemiSize() incredibly confusing
because it seems that some times live is the  true  amount  live  (after  the
copying  part  of the GC) and some times it is the amount alive from the last
GC.

In translatePointer(), wouldn't it be cheaper (low level tweak, and  probably
not  important)  to  make s->translateDirection a bool (named something else)
with the new TRUE being the current 1 and the new FALSE being the current -1.
(This assumes it is always +1 or -1.)

It  would  be  nice  to  have a bit more documentation in the code about what
translateDirection is doing.  Are you actually setting the first arg to  mmap
to  something?  Are you using MAP_FIXED?  I remember this as being very scary
to me since it seemed that you could land on memory  used  for  other  things
(like  shared libraries or C code mmap's) and not get a failure.  The result,
if this happens, would be disastrous.

In resizeHeap(), shouldn't `20' be a #define  or  enum  like  LIVE_RATIO  and
friends?  (Same for `3'.)

Wouldn't  it  be  much better to have alternate C files for shrinkFromSpace()
for the CYGWIN and linux cases?  I guess that  wouldn't  work  if  there  are
problems with the static stuff, but it seems pretty ugly (although small).

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