[project @ 2003-01-22 10:56:27 by ross]
authorross <unknown>
Wed, 22 Jan 2003 10:56:27 +0000 (10:56 +0000)
committerross <unknown>
Wed, 22 Jan 2003 10:56:27 +0000 (10:56 +0000)
use mallocForeignPtrArray from Foreign.ForeignPtr

Data/Array/Storable.hs

index f943f9a..39abe70 100644 (file)
@@ -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