bytezap-1.4.0: Bytestring builder with zero intermediate allocation
Safe HaskellSafe-Inferred
LanguageGHC2021

Tmp.BSExt

Description

raehik's bytestring extras (reimplementations of unexported internals).

Synopsis

Documentation

createFp :: Int -> (ForeignPtr Word8 -> IO ()) -> IO ByteString Source #

Create a ByteString of size l and use action f to fill its contents.

Reimplemented from the unexported function 'Data.ByteString.Internal.Type.createFp.

memcpyFp :: ForeignPtr Word8 -> ForeignPtr Word8 -> Int -> IO () Source #

Copy the given number of bytes from the second area (source) into the first (destination); the copied areas may not overlap.

Reimplemented from the unexported function memcpyFp.

createUptoNCPS :: Int -> (Ptr Word8 -> (Int -> IO ByteString) -> IO r) -> IO r Source #

createCPS :: Int -> (ForeignPtr Word8 -> Int -> IO r) -> ((Int -> IO r) -> Ptr Word8 -> IO r) -> IO r Source #

createAndTrimCPS :: Int -> (Ptr Word8 -> (Int -> IO ByteString) -> IO r) -> IO r Source #

wrapAction :: (Ptr Word8 -> IO res) -> ForeignPtr Word8 -> IO res Source #

mkDeferredByteString :: ForeignPtr Word8 -> Int -> IO ByteString #

Variant of fromForeignPtr0 that calls deferForeignPtrAvailability

Since: bytestring-0.11.5.0