Skip to content

Commit

Permalink
tx-submission: added NOINLINE pragmas
Browse files Browse the repository at this point in the history
The `continueWithState` and `continuewWithStateM` functions need
`NOINLINE` pragma to make sure the `st` argument is evaluated to WHNF.
  • Loading branch information
coot committed Aug 4, 2023
1 parent 97853bb commit 108fe32
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ continueWithStateM :: NoThunks s
-> m (ServerStIdle n txid tx m ())
continueWithStateM (StatefulM f) !st =
checkInvariant (show <$> unsafeNoThunks st) (f st)
{-# NOINLINE continueWithStateM #-}

-- | A variant of 'continueWithState' to be more easily utilized with
-- 'handleReply'.
Expand All @@ -518,3 +519,4 @@ collectAndContinueWithState :: NoThunks s
-> m (ServerStIdle n txid tx m ())
collectAndContinueWithState (StatefulCollect f) !st c =
checkInvariant (show <$> unsafeNoThunks st) (f st c)
{-# NOINLINE collectAndContinueWithState #-}

0 comments on commit 108fe32

Please sign in to comment.