Skip to content

Commit

Permalink
Fix a latent NoThunks failure
Browse files Browse the repository at this point in the history
We now check `NoThunks` even when assertions are disabled. With assertions
enabled, some data was evaluated as part of the assertion checking, which is
evaluated without assertions enabled.
  • Loading branch information
jorisdral committed Jan 14, 2025
1 parent 9fd4efe commit cb60830
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src-extras/Database/LSMTree/Extras/NoThunks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,22 @@ deriving stock instance Generic (RunReader m h)
deriving anyclass instance (Typeable m, Typeable (PrimState m), Typeable h)
=> NoThunks (RunReader m h)

deriving stock instance Generic (Reader.Entry m h)
deriving anyclass instance (Typeable m, Typeable (PrimState m), Typeable h)
=> NoThunks (Reader.Entry m h)
-- | Allows thunks in the overflow pages
instance ( Typeable m, Typeable (PrimState m), Typeable h
) => NoThunks (Reader.Entry m h) where
showTypeOf (p :: Proxy (Reader.Entry m h)) = show $ typeRep p
wNoThunks ctx (Reader.Entry (e :: Entry SerialisedValue (RawBlobRef m h))) = noThunks ctx e
wNoThunks ctx (EntryOverflow
(entryPrefix :: Entry SerialisedValue (RawBlobRef m h))
(page :: RawPage)
(len :: Word32)
(overflowPages :: [RawOverflowPage]) ) =
allNoThunks [
noThunks ctx entryPrefix
, noThunks ctx page
, noThunks ctx len
, noThunks ctx (OnlyCheckWhnf overflowPages)
]

{-------------------------------------------------------------------------------
RawPage
Expand Down

0 comments on commit cb60830

Please sign in to comment.