summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2020-04-12 19:08:58 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-14 23:31:38 -0400
commit19de2fb090a25ab0d640d0cd5aef09f35e7455a0 (patch)
treeaa76c39e33f0cb6f6ebf5f9265ed5a6dc19dc323 /includes
parent1dd3d18c2afd9e6009cd53295d26f8b31ca58fec (diff)
downloadhaskell-19de2fb090a25ab0d640d0cd5aef09f35e7455a0.tar.gz
rts: Assert LDV_recordDead is not called for inherently used closures
The comments make it clear LDV_recordDead should not be called for inhererently used closures, so add an assertion to codify this fact.
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/storage/ClosureMacros.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h
index 262a4380c4..ade8b34631 100644
--- a/includes/rts/storage/ClosureMacros.h
+++ b/includes/rts/storage/ClosureMacros.h
@@ -532,6 +532,7 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n)
#if defined(PROFILING)
void LDV_recordDead (const StgClosure *c, uint32_t size);
+RTS_PRIVATE bool isInherentlyUsed ( StgHalfWord closure_type );
#endif
EXTERN_INLINE void overwritingClosure_ (StgClosure *p,
@@ -559,6 +560,9 @@ EXTERN_INLINE void overwritingClosure_ (StgClosure *p, uint32_t offset, uint32_t
EXTERN_INLINE void overwritingClosure (StgClosure *p);
EXTERN_INLINE void overwritingClosure (StgClosure *p)
{
+#if defined(PROFILING)
+ ASSERT(!isInherentlyUsed(get_itbl(p)->type));
+#endif
overwritingClosure_(p, sizeofW(StgThunkHeader), closure_sizeW(p),
/*inherently_used=*/false);
}
@@ -589,5 +593,8 @@ EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset)
EXTERN_INLINE void overwritingClosureSize (StgClosure *p, uint32_t size /* in words */);
EXTERN_INLINE void overwritingClosureSize (StgClosure *p, uint32_t size)
{
+#if defined(PROFILING)
+ ASSERT(!isInherentlyUsed(get_itbl(p)->type));
+#endif
overwritingClosure_(p, sizeofW(StgThunkHeader), size, /*inherently_used=*/false);
}