{-# language BangPatterns #-}
{-# language BlockArguments #-}
{-# language DeriveAnyClass #-}
{-# language DerivingStrategies #-}
{-# language MagicHash #-}
{-# language UnboxedTuples #-}
{-# language UnliftedFFITypes #-}
module Lz4.Internal
( requiredBufferSize
, c_hs_compress_HC
) where
import Control.Monad.ST (runST)
import Control.Monad.ST.Run (runByteArrayST)
import Data.Bytes.Types (Bytes(Bytes))
import Data.Primitive (MutableByteArray(..),ByteArray(..))
import GHC.Exts (ByteArray#,MutableByteArray#)
import GHC.IO (unsafeIOToST)
import GHC.ST (ST(ST))
import qualified Control.Exception
import qualified Data.Primitive as PM
import qualified GHC.Exts as Exts
requiredBufferSize :: Int -> Int
requiredBufferSize :: Int -> Int
requiredBufferSize Int
s = Int
s forall a. Num a => a -> a -> a
+ (forall a. Integral a => a -> a -> a
div Int
s Int
255) forall a. Num a => a -> a -> a
+ Int
16
foreign import ccall unsafe "hs_compress_HC"
c_hs_compress_HC ::
ByteArray#
-> Int
-> MutableByteArray# s
-> Int
-> Int
-> Int
-> Int
-> IO Int