bloomfilter 1.2.6.1 → 1.2.6.2
raw patch · 4 files changed
+10/−13 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/BloomFilter/Array.hs +1/−1
- Data/BloomFilter/Hash.hs +7/−10
- bloomfilter.cabal +1/−1
- cbits/lookup3.h +1/−1
Data/BloomFilter/Array.hs view
@@ -15,7 +15,7 @@ {-# INLINE newArray #-} newArray numElems numBytes = do ary@(STUArray _ _ _ marr#) <- unsafeNewArray_ (0, numElems - 1)- unsafeIOToST (memset marr# 0 (fromIntegral numBytes))+ _ <- unsafeIOToST (memset marr# 0 (fromIntegral numBytes)) return ary foreign import ccall unsafe "memset"
Data/BloomFilter/Hash.hs view
@@ -61,16 +61,16 @@ -- import Prelude hiding ((/), (*), div, divMod, mod, rem) foreign import ccall unsafe "lookup3.h _jenkins_hashword" hashWord- :: Ptr CInt -> CSize -> CInt -> IO CInt+ :: Ptr Word32 -> CSize -> Word32 -> IO Word32 foreign import ccall unsafe "lookup3.h _jenkins_hashword2" hashWord2- :: Ptr CInt -> CSize -> Ptr CInt -> Ptr CInt -> IO ()+ :: Ptr Word32 -> CSize -> Ptr Word32 -> Ptr Word32 -> IO () foreign import ccall unsafe "lookup3.h _jenkins_hashlittle" hashLittle- :: Ptr a -> CSize -> CInt -> IO CInt+ :: Ptr a -> CSize -> Word32 -> IO Word32 foreign import ccall unsafe "lookup3.h _jenkins_hashlittle2" hashLittle2- :: Ptr a -> CSize -> Ptr CInt -> Ptr CInt -> IO ()+ :: Ptr a -> CSize -> Ptr Word32 -> Ptr Word32 -> IO () class Hashable a where -- | Compute a 32-bit hash of a value. The salt value perturbs@@ -222,13 +222,10 @@ alignedHash :: Ptr a -> CSize -> Word32 -> IO Word32 alignedHash ptr bytes salt- | bytes .&. 3 == 0 = hashWord (castPtr ptr) (div4 bytes) salt' >>= cast32- | otherwise = hashLittle ptr bytes salt' >>= cast32+ | bytes .&. 3 == 0 = hashWord (castPtr ptr) (div4 bytes) salt'+ | otherwise = hashLittle ptr bytes salt' where salt' = fromIntegral salt -cast32 :: CInt -> IO Word32-cast32 = return . fromIntegral- -- Inlined from Foreign.Marshal.Utils, for performance reasons. with :: Storable a => a -> (Ptr a -> IO b) -> IO b with val f =@@ -244,7 +241,7 @@ doubleHash ptr bytes p1 p2 peek sp -doubleHash :: Ptr a -> CSize -> Ptr CInt -> Ptr CInt -> IO ()+doubleHash :: Ptr a -> CSize -> Ptr Word32 -> Ptr Word32 -> IO () doubleHash ptr bytes p1 p2 | bytes .&. 3 == 0 = hashWord2 (castPtr ptr) (div4 bytes) p1 p2 | otherwise = hashLittle2 ptr bytes p1 p2
bloomfilter.cabal view
@@ -1,5 +1,5 @@ name: bloomfilter-version: 1.2.6.1+version: 1.2.6.2 license: BSD3 license-file: LICENSE author: Bryan O'Sullivan <bos@serpentine.com>
cbits/lookup3.h view
@@ -29,7 +29,7 @@ /* * */-#if (defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ == 610)+#if (defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 610) # define MAYBESTATIC #else # define MAYBESTATIC static inline