summaryrefslogtreecommitdiff
path: root/rts/sm/Compact.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2016-05-18 06:33:03 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2016-05-18 06:33:03 +1000
commit33c029dd77888ee5f9b1c7ce8884c982e0428adf (patch)
tree6c38a3f4c4dcc2fb20a8ce4a1c9d1dc520ec6f9d /rts/sm/Compact.c
parent5d80d14196ef048ffe037b2d92af2e9af0cb9e19 (diff)
downloadhaskell-33c029dd77888ee5f9b1c7ce8884c982e0428adf.tar.gz
rts: More const correct-ness fixes
In addition to more const-correctness fixes this patch fixes an infelicity of the previous const-correctness patch (995cf0f356) which left `UNTAG_CLOSURE` taking a `const StgClosure` pointer parameter but returning a non-const pointer. Here we restore the original type signature of `UNTAG_CLOSURE` and add a new function `UNTAG_CONST_CLOSURE` which takes and returns a const `StgClosure` pointer and uses that wherever possible. Test Plan: Validate on Linux, OS X and Windows Reviewers: Phyx, hsyl20, bgamari, austin, simonmar, trofi Reviewed By: simonmar, trofi Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2231
Diffstat (limited to 'rts/sm/Compact.c')
-rw-r--r--rts/sm/Compact.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c
index 4ded5bf92b..ec178e91ef 100644
--- a/rts/sm/Compact.c
+++ b/rts/sm/Compact.c
@@ -169,7 +169,8 @@ loop:
case 1:
{
StgWord r = *(StgPtr)(q-1);
- ASSERT(LOOKS_LIKE_INFO_PTR((StgWord)UNTAG_CLOSURE((StgClosure *)r)));
+ ASSERT(LOOKS_LIKE_INFO_PTR((StgWord)
+ UNTAG_CONST_CLOSURE((StgClosure *)r)));
return r;
}
case 2:
@@ -539,7 +540,7 @@ update_fwd_large( bdescr *bd )
// ToDo: too big to inline
static /* STATIC_INLINE */ StgPtr
-thread_obj (StgInfoTable *info, StgPtr p)
+thread_obj (const StgInfoTable *info, StgPtr p)
{
switch (info->type) {
case THUNK_0_1:
@@ -738,7 +739,7 @@ update_fwd( bdescr *blocks )
{
StgPtr p;
bdescr *bd;
- StgInfoTable *info;
+ const StgInfoTable *info;
bd = blocks;
@@ -848,7 +849,7 @@ update_bkwd_compact( generation *gen )
StgWord m;
#endif
bdescr *bd, *free_bd;
- StgInfoTable *info;
+ const StgInfoTable *info;
StgWord size;
W_ free_blocks;
StgWord iptr;