@@ -117,7 +117,7 @@ module Streamly.Internal.Data.MutArray.Type
117117 , fromChunksK
118118 , fromChunksRealloced -- fromSmallChunks
119119
120- , unsafePinnedCreateUsingPtr
120+ , unsafeCreateWithPtr'
121121
122122 -- ** Random writes
123123 , putIndex
@@ -3526,18 +3526,18 @@ unsafeAsPtr arr f =
35263526 (arrContents arr)
35273527 (\ ptr -> f (ptr `plusPtr` arrStart arr) (byteLength arr))
35283528
3529- -- | @unsafePinnedCreateUsingPtr capacity populator@ creates a pinned array of
3529+ -- | @unsafeCreateWithPtr' capacity populator@ creates a pinned array of
35303530-- @capacity@ bytes and invokes the @populator@ function to populate it.
35313531-- @populator ptr len@ gets the pointer to the array and MUST return the amount
35323532-- of the capacity populated in bytes.
35333533--
35343534-- /Unsafe/ because the populator is allowed to use the pointer only up to
35353535-- specified length. In other words, bytes populated MUST be less than or equal
35363536-- to the total capacity.
3537- {-# INLINE unsafePinnedCreateUsingPtr #-}
3538- unsafePinnedCreateUsingPtr
3537+ {-# INLINE unsafeCreateWithPtr' #-}
3538+ unsafeCreateWithPtr'
35393539 :: MonadIO m => Int -> (Ptr Word8 -> IO Int ) -> m (MutArray Word8 )
3540- unsafePinnedCreateUsingPtr cap pop = do
3540+ unsafeCreateWithPtr' cap pop = do
35413541 (arr :: MutArray Word8 ) <- emptyOf' cap
35423542 len <- Unboxed. unsafeAsPtr (arrContents arr) pop
35433543 when (len > cap) (error (errMsg len))
@@ -3548,7 +3548,7 @@ unsafePinnedCreateUsingPtr cap pop = do
35483548 where
35493549
35503550 errMsg len =
3551- " unsafePinnedCreateUsingPtr : length > capacity, "
3551+ " unsafeCreateWithPtr' : length > capacity, "
35523552 ++ " length = " ++ show len ++ " , "
35533553 ++ " capacity = " ++ show cap
35543554
0 commit comments