From 4f8d9626fbfc69831111a0e5239219a519df37df Mon Sep 17 00:00:00 2001 From: ross Date: Wed, 22 Jan 2003 10:56:27 +0000 Subject: [PATCH] [project @ 2003-01-22 10:56:27 by ross] use mallocForeignPtrArray from Foreign.ForeignPtr --- Data/Array/Storable.hs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Data/Array/Storable.hs b/Data/Array/Storable.hs index f943f9a..39abe70 100644 --- a/Data/Array/Storable.hs +++ b/Data/Array/Storable.hs @@ -74,13 +74,6 @@ instance Storable e => MArray StorableArray e IO where unsafeWrite (StorableArray _ _ fp) i e = withForeignPtr fp $ \a -> pokeElemOff a i e --- adapted from Foreign.Marshall.Array.mallocArray -mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a) -mallocForeignPtrArray = doMalloc undefined - where - doMalloc :: Storable a => a -> Int -> IO (ForeignPtr a) - doMalloc dummy size = mallocForeignPtrBytes (size * sizeOf dummy) - withStorableArray :: StorableArray i e -> (Ptr e -> IO a) -> IO a withStorableArray (StorableArray _ _ fp) f = withForeignPtr fp f -- 1.7.10.4