summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-17 09:27:06 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-19 11:57:36 -0500
commitc819c0e413069cb4e16236fb3e6576658060a17d (patch)
treeeb193aa80a9f7e704769070e2685cbc918492993 /includes
parent0418c38d55c7a47967187dce2db5ea2ab1021b1e (diff)
downloadhaskell-c819c0e413069cb4e16236fb3e6576658060a17d.tar.gz
nonmoving: Use correct info table pointer accessor
Previously we used INFO_PTR_TO_STRUCT instead of THUNK_INFO_PTR_TO_STRUCT when looking at a thunk. These two happen to be equivalent on 64-bit architectures due to alignment considerations however they are different on 32-bit platforms. This lead to #17487. To fix this we also employ a small optimization: there is only one thunk of type WHITEHOLE (namely stg_WHITEHOLE_info). Consequently, we can just use a plain pointer comparison instead of testing against info->type.
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/storage/ClosureMacros.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h
index b5ae2dafc6..1b3628f2b9 100644
--- a/includes/rts/storage/ClosureMacros.h
+++ b/includes/rts/storage/ClosureMacros.h
@@ -107,20 +107,6 @@ INLINE_HEADER const StgConInfoTable *get_con_itbl(const StgClosure *c)
return CON_INFO_PTR_TO_STRUCT((c)->header.info);
}
-/* Used when we expect another thread to be mutating the info table pointer of
- * a closure (e.g. when busy-waiting on a WHITEHOLE).
- */
-INLINE_HEADER const StgInfoTable *get_volatile_itbl(StgClosure *c) {
- // The volatile here is import to ensure that the compiler does not
- // optimise away multiple loads, e.g. in a busy-wait loop. Note that
- // we can't use VOLATILE_LOAD here as the casts result in strict aliasing
- // rule violations and this header may be compiled outside of the RTS
- // (where we use -fno-strict-aliasing).
- StgInfoTable * *volatile p = (StgInfoTable * *volatile) &c->header.info;
- return INFO_PTR_TO_STRUCT(*p);
-}
-
-
INLINE_HEADER StgHalfWord GET_TAG(const StgClosure *con)
{
return get_itbl(con)->srt;