Skip to content

Commit 26a608f

Browse files
authored
Merge pull request #511 from IntersectMBO/jdral/specialise-hascallstackifdebug
Add missing `HasCallStackIfDebug` pragmas in `Ref` specialisations
2 parents 840c26a + 333d4d9 commit 26a608f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src-control/Control/RefCount.hs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,24 +203,18 @@ class RefCounted m obj | obj -> m where
203203
#endif
204204

205205
{-# SPECIALISE
206-
newRef ::
207-
RefCounted IO obj
208-
=> IO ()
209-
-> (RefCounter IO -> obj)
210-
-> IO (Ref obj)
206+
newRef ::
207+
RefCounted IO obj
208+
=> HasCallStackIfDebug
209+
=> IO ()
210+
-> (RefCounter IO -> obj)
211+
-> IO (Ref obj)
211212
#-}
212213
-- | Make a new reference.
213214
--
214215
-- The given finaliser is run when the last reference is released. The
215216
-- finaliser is run with async exceptions masked.
216217
--
217-
{-# SPECIALISE
218-
newRef ::
219-
RefCounted IO obj
220-
=> IO ()
221-
-> (RefCounter IO -> obj)
222-
-> IO (Ref obj)
223-
#-}
224218
newRef ::
225219
(RefCounted m obj, PrimMonad m)
226220
=> HasCallStackIfDebug
@@ -239,6 +233,7 @@ newRef finaliser mkObject = do
239233
{-# SPECIALISE
240234
releaseRef ::
241235
RefCounted IO obj
236+
=> HasCallStackIfDebug
242237
=> Ref obj
243238
-> IO ()
244239
#-}
@@ -273,7 +268,8 @@ deRef ref@Ref{refobj} =
273268

274269
{-# SPECIALISE
275270
withRef ::
276-
Ref obj
271+
HasCallStackIfDebug
272+
=> Ref obj
277273
-> (obj -> IO a)
278274
-> IO a
279275
#-}
@@ -295,6 +291,7 @@ withRef ref@Ref{refobj} f = do
295291
{-# SPECIALISE
296292
dupRef ::
297293
RefCounted IO obj
294+
=> HasCallStackIfDebug
298295
=> Ref obj
299296
-> IO (Ref obj)
300297
#-}
@@ -333,6 +330,7 @@ mkWeakRefFromRaw obj = WeakRef obj
333330
{-# SPECIALISE
334331
deRefWeak ::
335332
RefCounted IO obj
333+
=> HasCallStackIfDebug
336334
=> WeakRef obj
337335
-> IO (Maybe (Ref obj))
338336
#-}

0 commit comments

Comments
 (0)