ghc-events 0.7.2 → 0.7.3
raw patch · 3 files changed
+16/−12 lines, 3 filesdep ~containersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: containers
API changes (from Hackage documentation)
- GHC.RTS.Events.Analysis: instance (GHC.Show.Show a, GHC.Show.Show e) => GHC.Show.Show (GHC.RTS.Events.Analysis.Process e a)
+ GHC.RTS.Events.Analysis: instance (GHC.Show.Show e, GHC.Show.Show a) => GHC.Show.Show (GHC.RTS.Events.Analysis.Process e a)
+ GHC.RTS.Events.Merge: instance GHC.Base.Semigroup GHC.RTS.Events.Merge.MaxVars
- GHC.RTS.Events.Analysis: Machine :: s -> (s -> Bool) -> (i -> Bool) -> (s -> i -> Maybe s) -> Machine s i
+ GHC.RTS.Events.Analysis: Machine :: s -> s -> Bool -> i -> Bool -> s -> i -> Maybe s -> Machine s i
Files
- CHANGELOG.md +5/−0
- ghc-events.cabal +2/−2
- src/GHC/RTS/Events/Incremental.hs +9/−10
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Change Log +## 0.7.3 - 2018-07-10++* Fixed memory-leak in incremental readEvents ([#37](https://github.com/haskell/ghc-events/pull/37))+* Relax upper version bound for containers ([#38](https://github.com/haskell/ghc-events/pull/38))+ ## 0.7.2 - 2018-03-13 * Add Semigroup instance for MaxVars to build with ghc-8.4
ghc-events.cabal view
@@ -1,5 +1,5 @@ name: ghc-events-version: 0.7.2+version: 0.7.3 synopsis: Library and tool for parsing .eventlog files from GHC description: Parses .eventlog files emitted by GHC 6.12.1 and later. Includes the ghc-events tool permitting, in particular,@@ -59,7 +59,7 @@ library build-depends: base >= 4 && < 4.12,- containers >= 0.5 && < 0.6,+ containers >= 0.5 && < 0.7, binary >= 0.7 && < 0.10, bytestring >= 0.10.4, array >= 0.2 && < 0.6,
src/GHC/RTS/Events/Incremental.hs view
@@ -42,7 +42,7 @@ | Done B.ByteString -- ^ The decoder has ended with leftover input. | Error B.ByteString String- -- ^ The decoder has encountered an error with lefover input and an error+ -- ^ The decoder has encountered an error with leftover input and an error -- message. -- | Push an input chunk to the decoder@@ -118,22 +118,21 @@ Error _ err -> fail err Right header -> Right (header, bytes) + -- | Read events from a lazy bytestring. It returns an error message if it--- encouters an error while decoding.+-- encounters an error while decoding. -- -- Note that it doesn't fail if it consumes all input in the middle of decoding -- of an event. readEvents :: Header -> BL.ByteString -> ([Event], Maybe String)-readEvents header = f . go (decodeEvents header)+readEvents header = f . break isLeft . go (decodeEvents header) where- f :: [Either e a] -> ([a], Maybe e)- f xs = (rights rs, listToMaybe (lefts ls))- where- (rs, ls) = break isLeft xs+ f (rs, ls) = (rights rs, listToMaybe (lefts ls)) #if !MIN_VERSION_base(4, 7, 0)- isLeft (Left _) = True- isLeft _ = False+ isLeft (Left _) = True+ isLeft _ = False #endif+ go :: Decoder Event -> BL.ByteString -> [Either String Event] go decoder bytes = case decoder of Produce event decoder' -> Right event : go decoder' bytes@@ -144,7 +143,7 @@ Error _ err -> [Left err] -- | Read an entire eventlog from a lazy bytestring. It returns an error message if it--- encouters an error while decoding.+-- encounters an error while decoding. -- -- Note that it doesn't fail if it consumes all input in the middle of decoding -- of an event.