@@ -83,6 +83,7 @@ import Database.LSMTree.Internal.WriteBuffer (WriteBuffer)
8383import qualified Database.LSMTree.Internal.WriteBuffer as WB
8484import Database.LSMTree.Internal.WriteBufferBlobs (WriteBufferBlobs )
8585import qualified Database.LSMTree.Internal.WriteBufferBlobs as WBB
86+ import GHC.Stack (HasCallStack )
8687import qualified System.FS.API as FS
8788import System.FS.API (HasFS )
8889import System.FS.BlockIO.API (HasBlockIO )
@@ -198,14 +199,15 @@ data LevelsCache m h = LevelsCache_ {
198199 }
199200
200201{-# SPECIALISE mkLevelsCache ::
201- ActionRegistry IO
202+ HasCallStack
203+ => ActionRegistry IO
202204 -> Levels IO h
203205 -> IO (LevelsCache IO h) #-}
204206-- | Flatten the argument 'Level's into a single vector of runs, including all
205207-- runs that are inputs to an ongoing merge. Use that to populate the
206208-- 'LevelsCache'. The cache will take a reference for each of its runs.
207209mkLevelsCache ::
208- forall m h . (PrimMonad m , MonadMVar m , MonadMask m )
210+ forall m h . (HasCallStack , PrimMonad m , MonadMVar m , MonadMask m )
209211 => ActionRegistry m
210212 -> Levels m h
211213 -> m (LevelsCache m h )
@@ -239,7 +241,8 @@ mkLevelsCache reg lvls = do
239241 (incoming <> ) . fold <$> V. forM rs k1
240242
241243{-# SPECIALISE rebuildCache ::
242- ActionRegistry IO
244+ HasCallStack
245+ => ActionRegistry IO
243246 -> LevelsCache IO h
244247 -> Levels IO h
245248 -> IO (LevelsCache IO h) #-}
@@ -264,7 +267,7 @@ mkLevelsCache reg lvls = do
264267-- a solution to keep blob references valid until the next /update/ comes along.
265268-- Lookups should no invalidate blob erferences.
266269rebuildCache ::
267- (PrimMonad m , MonadMVar m , MonadMask m )
270+ (HasCallStack , PrimMonad m , MonadMVar m , MonadMask m )
268271 => ActionRegistry m
269272 -> LevelsCache m h -- ^ old cache
270273 -> Levels m h -- ^ new levels
@@ -274,11 +277,12 @@ rebuildCache reg oldCache newLevels = do
274277 mkLevelsCache reg newLevels
275278
276279{-# SPECIALISE duplicateLevelsCache ::
277- ActionRegistry IO
280+ HasCallStack
281+ => ActionRegistry IO
278282 -> LevelsCache IO h
279283 -> IO (LevelsCache IO h) #-}
280284duplicateLevelsCache ::
281- (PrimMonad m , MonadMask m )
285+ (HasCallStack , PrimMonad m , MonadMask m )
282286 => ActionRegistry m
283287 -> LevelsCache m h
284288 -> m (LevelsCache m h )
@@ -288,11 +292,12 @@ duplicateLevelsCache reg cache = do
288292 pure cache { cachedRuns = rs' }
289293
290294{-# SPECIALISE releaseLevelsCache ::
291- ActionRegistry IO
295+ HasCallStack
296+ => ActionRegistry IO
292297 -> LevelsCache IO h
293298 -> IO () #-}
294299releaseLevelsCache ::
295- (PrimMonad m , MonadMask m )
300+ (HasCallStack , PrimMonad m , MonadMask m )
296301 => ActionRegistry m
297302 -> LevelsCache m h
298303 -> m ()
0 commit comments