Sun Jun 8 18:21:18 PDT 2008 Don Stewart * Use unpacking and inlining to ensure Vector can be stored unlifted at runtime New patches: [Use unpacking and inlining to ensure Vector can be stored unlifted at runtime Don Stewart **20080609012118] { hunk ./lib/Data/Packed/Internal/Vector.hs 24 +import GHC.Base +import GHC.IOBase + hunk ./lib/Data/Packed/Internal/Vector.hs 28 -data Vector t = V { dim :: Int -- ^ number of elements - , fptr :: ForeignPtr t -- ^ foreign pointer to the memory block +data Vector t = V { dim :: {-# UNPACK #-} !Int -- ^ number of elements + , fptr :: {-# UNPACK #-}!(ForeignPtr t) -- ^ foreign pointer to the memory block hunk ./lib/Data/Packed/Internal/Vector.hs 59 -safeRead v = unsafePerformIO . withForeignPtr (fptr v) +safeRead v = inlinePerformIO . withForeignPtr (fptr v) +{-# INLINE safeRead #-} + +inlinePerformIO :: IO a -> a +inlinePerformIO (IO m) = case m realWorld# of (# _, r #) -> r +{-# INLINE inlinePerformIO #-} hunk ./lib/Data/Packed/Internal/Vector.hs 88 +{-# INLINE at #-} } Context: [range checking and other additions to the mutable interface Alberto Ruiz **20080606154148] [safe wrappers and examples/parallel.hs Alberto Ruiz **20080606120801] [really add Data.Packed.ST.hs Alberto Ruiz **20080605123525] [added acknowledgement to Bulat Alberto Ruiz **20080605122046] [remove updateVector and updateMatrix Alberto Ruiz **20080605121008] [first version of Data.Packed.ST Alberto Ruiz **20080605120440] [Data.Packed.Convert Alberto Ruiz **20080603090037] [added updateMatrix Alberto Ruiz **20080601120950] [added updateVector Alberto Ruiz **20080601113907] [TAG 0.3.0.0 Alberto Ruiz **20080527125906] Patch bundle hash: 189a5974a11e189e967d537176cf24e388e332e3