
19 Dec
2008
19 Dec
'08
9:49 a.m.
But why would you want that? I understand the only situation when talking about number of bytes makes sense is when you are using Foreign and Ptr. Besides that, you can only guess the amount of memory you need to deal with your data (taking laziness, GC etc. into account). Maurício
In a similar vein, is there already a function available to give the size of Word in bytes? Or should I write the usual Ptr conversion tricks to figure it out?
Holger Siegel wrote:
On Thursday 18 December 2008 13:40:47 Ryan Ingram wrote:
Actually, this is probably safer:
import Foreign.Marshal.Alloc import Foreign.Ptr import Foreign.Storable import Data.Word import System.IO.Unsafe