@@ -85,13 +85,9 @@ import qualified Data.ByteString.Unsafe as B
86#if defined(__GLASGOW_HASKELL__)
86#if defined(__GLASGOW_HASKELL__)
87import GHC.Base (realWorld#)
87import GHC.Base (realWorld#)
88−import GHC.Exts (inline)
89import GHC.IO (IO(IO))
88import GHC.IO (IO(IO))
91import System.IO.Unsafe (unsafePerformIO)
90import System.IO.Unsafe (unsafePerformIO)
97type Parser = T.Parser B.ByteString
93type Parser = T.Parser B.ByteString
@@ -116,9 +112,7 @@ ensure' !n0 i0 a0 m0 kf0 ks0 =
116ensure :: Int -> Parser B.ByteString
112ensure :: Int -> Parser B.ByteString
117ensure !n = T.Parser $ \i0 a0 m0 kf ks ->
113ensure !n = T.Parser $ \i0 a0 m0 kf ks ->
118 if B.length (unI i0) >= n
114 if B.length (unI i0) >= n
119− -- Inline the success continuation to avoid creating a closure in
120− -- the common case of enough data in the buffer:
121− then inline ks i0 a0 m0 (unI i0)
115+ then ks i0 a0 m0 (unI i0)
122 -- The uncommon case is kept out-of-line to reduce code size:
116 -- The uncommon case is kept out-of-line to reduce code size:
123 else ensure' n i0 a0 m0 kf ks
117 else ensure' n i0 a0 m0 kf ks
124-- Non-recursive so the bounds check can be inlined:
118-- Non-recursive so the bounds check can be inlined: