Skip to content

Commit 6daa65b

Browse files
committed
Fix #71: use getSizeofMutualByteArray#
1 parent f98e9d7 commit 6daa65b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/Text/Regex/TDFA/NewDFA/Engine.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Data.Array.Base(unsafeRead,unsafeWrite,STUArray(..))
1616
-- #ifdef __GLASGOW_HASKELL__
1717
import GHC.Arr(STArray(..))
1818
import GHC.ST(ST(..))
19-
import GHC.Exts(MutableByteArray#,RealWorld,Int#,sizeofMutableByteArray#,State#)
19+
import GHC.Exts(MutableByteArray#,RealWorld,Int#,getSizeofMutableByteArray#,State#)
2020
import Unsafe.Coerce (unsafeCoerce)
2121
{-
2222
-- #else
@@ -730,8 +730,8 @@ copySTU _source@(STUArray _ _ _ msource) _destination@(STUArray _ _ _ mdest) =
730730
-- b2 <- getBounds s2
731731
-- when (b1/=b2) (error ("\n\nWTF copySTU: "++show (b1,b2)))
732732
ST $ \s1# ->
733-
case sizeofMutableByteArray# msource of { n# ->
734-
case memcpyST mdest msource n# s1# of { (# s2#, _ #) ->
733+
case getSizeofMutableByteArray# msource s1# of { (# s1'#, n# #) ->
734+
case memcpyST mdest msource n# s1'# of { (# s2#, _ #) ->
735735
(# s2#, () #) }}
736736
{-
737737
-- #else /* !__GLASGOW_HASKELL__ */

lib/Text/Regex/TDFA/NewDFA/Engine_FA.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Data.Array.Base(unsafeRead,unsafeWrite,STUArray(..))
1717

1818
import GHC.Arr(STArray(..))
1919
import GHC.ST(ST(..))
20-
import GHC.Exts(MutableByteArray#,RealWorld,Int#,sizeofMutableByteArray#,unsafeCoerce#,State#)
20+
import GHC.Exts(MutableByteArray#,RealWorld,Int#,getSizeofMutableByteArray#,unsafeCoerce#,State#)
2121

2222
import Prelude hiding ((!!))
2323
import Control.Monad(when,unless,forM,forM_,liftM2,foldM)
@@ -622,8 +622,8 @@ copySTU _source@(STUArray _ _ _ msource) _destination@(STUArray _ _ _ mdest) =
622622
-- b2 <- getBounds s2
623623
-- when (b1/=b2) (error ("\n\nWTF copySTU: "++show (b1,b2)))
624624
ST $ \s1# ->
625-
case sizeofMutableByteArray# msource of { n# ->
626-
case memcpyST mdest msource n# s1# of { (# s2#, _ #) ->
625+
case getSizeofMutableByteArray# msource s1# of { (# s1'#, n# #) ->
626+
case memcpyST mdest msource n# s1'# of { (# s2#, _ #) ->
627627
(# s2#, () #) }}
628628
{-
629629
-- #else /* !__GLASGOW_HASKELL__ */

0 commit comments

Comments
 (0)