Version française
Home     About     Download     Resources     Contact us    
Browse thread
questions about costs of nativeint vs int
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Norman Ramsey <nr@e...>
Subject: Re: questions about costs of nativeint vs int
 > Values of type "nativeint", "int32" and "int64" are boxed
 > (heap-allocated and handled through a pointer), while values of type
 > "int" are unboxed...
 >
 > >   type loc = Cell of char * int * width
 > >            | Slice of ...
 > > 
 > >   type loc' = Cell of char * nativeint * width
 > >             | Slice of ...
 > 
 > A "Cell" requires two more memory words in the latter case.

Thanks for this very helpful reply.

I think for simplicity, we may go with nativeint now.  Another
question: are there any tools that would enable us to track, e.g.,
how much memory is being occupied by instances of "Cell", or even just
how many "Cells" might be live at a given moment?
That way we could evaluate the potential savings in moving to int for
some variants...


Norman