Skip to content

Commit

Permalink
Use PlainForeignPtr instead of LiteralPtr for literals
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewthad committed Nov 14, 2019
1 parent cdc5d36 commit 25a6db8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Data/ByteString/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ unsafePackAddress addr# = do
unsafePackLiteral :: Addr# -> ByteString
unsafePackLiteral addr# =
#if __GLASGOW_HASKELL__ >= 809
PS (ForeignPtr addr# LiteralPtr) 0 (I# (cstringLength# addr#))
PS
(accursedUnutterablePerformIO (newForeignPtr_ (Ptr addr#)))
0
(I# (cstringLength# addr#))
#else
let len = accursedUnutterablePerformIO (c_strlen (Ptr addr#))
in PS (accursedUnutterablePerformIO (newForeignPtr_ (Ptr addr#))) 0 (fromIntegral len)
Expand Down

0 comments on commit 25a6db8

Please sign in to comment.