MLton.size bug

Matthew Fluet Matthew Fluet <fluet@CS.Cornell.EDU>
Fri, 27 Apr 2001 14:00:15 -0400 (EDT)


Another quick size question:  What is the intended behavior of the
following?

val x = 1
val s_x = MLton.size x
val _ = print (concat [Int.toString s_x, "\n"])
val x = (2, 2)
val s_y = MLton.size y
val _ = print (concat [Int.toString s_y, "\n"])
(* go on to make sure that x and y are useful *)

I get 0 for the size of x and 12 for the size of y.  The 12 makes sense --
two 4 byte integers plus the 4 byte pointer into the heap.  But I would
think the size of x should be 4.  No uselessness is detected:

val global_1: int = 1
val global_23: int ref = Ref_ref(int) (global_1)
val x_1149: int = MLton_size(int) (global_23)