packages feed

lzlib 0.2.0.1 → 0.2.0.2

raw patch · 3 files changed

+8/−5 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # lzlib +## 0.2.0.2++  * Performance improvements+ ## 0.2.0.1    * Performance improvements
lzlib.cabal view
@@ -1,6 +1,6 @@ cabal-version:      1.18 name:               lzlib-version:            0.2.0.1+version:            0.2.0.2 license:            BSD3 license-file:       LICENSE copyright:          Copyright: (c) 2019 Vanessa McHale
src/Codec/Lzip.hs view
@@ -15,10 +15,9 @@ import qualified Data.ByteString.Lazy  as BSL import           Data.Int              (Int64) import           Data.Maybe            (fromMaybe)-import           Data.Semigroup import           Foreign.Marshal.Alloc (free, mallocBytes) import           Foreign.Ptr           (Ptr, castPtr, plusPtr)-import           System.IO.Unsafe      (unsafePerformIO)+import           System.IO.Unsafe      (unsafeDupablePerformIO)  data CompressionLevel = Zero                       | One@@ -51,7 +50,7 @@ -- [lziprecover](https://www.nongnu.org/lzip/lziprecover.html). {-# NOINLINE decompress #-} decompress :: BS.ByteString -> BSL.ByteString-decompress bs = unsafePerformIO $ BS.useAsCStringLen bs $ \(bytes, sz) -> do+decompress bs = unsafeDupablePerformIO $ BS.useAsCStringLen bs $ \(bytes, sz) -> do      decoder <- lZDecompressOpen     maxSz <- lZDecompressWriteSize decoder@@ -87,7 +86,7 @@  {-# NOINLINE compressWith #-} compressWith :: CompressionLevel -> BS.ByteString -> BSL.ByteString-compressWith level bs = unsafePerformIO $ BS.useAsCStringLen bs $ \(bytes, sz) -> do+compressWith level bs = unsafeDupablePerformIO $ BS.useAsCStringLen bs $ \(bytes, sz) -> do      encoder <- lZCompressOpen (fromIntegral $ dictionarySize sz) (fromIntegral matchLenLimit) (fromIntegral memberSize)