diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-01-12 09:43:23 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-02-01 16:24:54 +0000 |
commit | b3182fdbeb491491d50f9eca448a84d9b76e987c (patch) | |
tree | 59763a3eeebac8540dd09281f0b96fa78978fe64 | |
parent | d4bcd37f15a59cea22fbaef280cd85cac20872bf (diff) | |
download | haskell-wip/missing-heap-instances.tar.gz |
Add missing instances to ghc-heap typeswip/missing-heap-instances
These instances are useful so that a `GenClosure` form `ghc-heap` can be
used as a key in a `Map`. Therefore the order itself is not important
but just the fact that there is one.
-rw-r--r-- | libraries/ghc-heap/GHC/Exts/Heap/Closures.hs | 8 | ||||
-rw-r--r-- | libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs b/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs index 3c5d5f1c32..1a6a9371d4 100644 --- a/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs +++ b/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs @@ -368,7 +368,7 @@ data PrimType | PAddr | PFloat | PDouble - deriving (Eq, Show, Generic) + deriving (Eq, Show, Generic, Ord) data WhatNext = ThreadRunGHC @@ -376,7 +376,7 @@ data WhatNext | ThreadKilled | ThreadComplete | WhatNextUnknownValue Word16 -- ^ Please report this as a bug - deriving (Eq, Show, Generic) + deriving (Eq, Show, Generic, Ord) data WhyBlocked = NotBlocked @@ -394,7 +394,7 @@ data WhyBlocked | ThreadMigrating | BlockedOnIOCompletion | WhyBlockedUnknownValue Word16 -- ^ Please report this as a bug - deriving (Eq, Show, Generic) + deriving (Eq, Show, Generic, Ord) data TsoFlags = TsoLocked @@ -405,7 +405,7 @@ data TsoFlags | TsoSqueezed | TsoAllocLimit | TsoFlagsUnknownValue Word32 -- ^ Please report this as a bug - deriving (Eq, Show, Generic) + deriving (Eq, Show, Generic, Ord) -- | For generic code, this function returns all referenced closures. allClosures :: GenClosure b -> [b] diff --git a/libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs b/libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs index b6915b374d..579d29098c 100644 --- a/libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs +++ b/libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs @@ -11,7 +11,7 @@ import GHC.Generics -- for more details on this data structure. data StgTSOProfInfo = StgTSOProfInfo { cccs :: Maybe CostCentreStack -} deriving (Show, Generic) +} deriving (Show, Generic, Eq, Ord) -- | This is a somewhat faithful representation of CostCentreStack. See -- <https://gitlab.haskell.org/ghc/ghc/blob/master/includes/rts/prof/CCS.h> @@ -29,7 +29,7 @@ data CostCentreStack = CostCentreStack { ccs_mem_alloc :: Word64, ccs_inherited_alloc :: Word64, ccs_inherited_ticks :: Word -} deriving (Show, Generic, Eq) +} deriving (Show, Generic, Eq, Ord) -- | This is a somewhat faithful representation of CostCentre. See -- <https://gitlab.haskell.org/ghc/ghc/blob/master/includes/rts/prof/CCS.h> @@ -43,7 +43,7 @@ data CostCentre = CostCentre { cc_time_ticks :: Word, cc_is_caf :: Bool, cc_link :: Maybe CostCentre -} deriving (Show, Generic, Eq) +} deriving (Show, Generic, Eq, Ord) -- | This is a somewhat faithful representation of IndexTable. See -- <https://gitlab.haskell.org/ghc/ghc/blob/master/includes/rts/prof/CCS.h> @@ -53,4 +53,4 @@ data IndexTable = IndexTable { it_ccs :: Maybe CostCentreStack, it_next :: Maybe IndexTable, it_back_edge :: Bool -} deriving (Show, Generic, Eq) +} deriving (Show, Generic, Eq, Ord) |