using sizeof information in SML

brian <briand-/[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
I ran across the following in my code :

     let val size = (C.T.sizeof T_fftw_complex.typ)
         (* really, really should not use *16 as this implicitly
         assumes that the sizeof(double) = 8.  Eventually sizeof should
         be used. *)
         val ptr = F_fftw_malloc.f(Int32.fromInt(n*16))

The problem of course is that I should be using n*size

I can't seem to figure out what the type of size is, so I can't turn  
it into an Int32 by applying the appropriate transmogrification.

The type in the error message if I just try size*n is :

T_fftw_complex.t ?.C.size

Which I can't make sense of.

I'm thinking there's just gotta be a built-in function in nlffi which  
can take a blah-blah-size and turn it into an integer for you, right ?


Brian


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.