major missing piece to arrays?

John Meacham john at repetae.net
Thu Jul 15 17:07:49 EDT 2004


On Thu, Jul 15, 2004 at 04:20:38PM +0200, Jérémy Bobbio wrote:
> memcpy is available in Foreign.Marshal.Utils:
> 
>      copyBytes :: Ptr a -> Ptr a -> Int -> IO ()
> 
>      Copies the given number of bytes from the second area (source)
>      into the first (destination);the copied areas may not overlap
> 
> Here is the result of a quick try to implement fast copy using it and 
> Data.Array.Storable:

Yeah, 
I know I can copy areas of memory allocated via the foreign library or C
code around. What I am looking for is an efficient way to work with
the standard Arrays as provided by Data.Array. 

Also, in my tests, arrays implemented via ByteArray# or Ptr a seem to be
signifigantly faster than those implemented via ForeignPtr. Is this
expected?

        John

-- 
John Meacham


More information about the Glasgow-haskell-users mailing list