diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-05-18 06:33:03 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-05-18 06:33:03 +1000 |
commit | 33c029dd77888ee5f9b1c7ce8884c982e0428adf (patch) | |
tree | 6c38a3f4c4dcc2fb20a8ce4a1c9d1dc520ec6f9d /rts/CheckUnload.c | |
parent | 5d80d14196ef048ffe037b2d92af2e9af0cb9e19 (diff) | |
download | haskell-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/CheckUnload.c')
-rw-r--r-- | rts/CheckUnload.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/CheckUnload.c b/rts/CheckUnload.c index bb51638455..d303315981 100644 --- a/rts/CheckUnload.c +++ b/rts/CheckUnload.c @@ -38,7 +38,7 @@ // object as referenced so that it won't get unloaded in this round. // -static void checkAddress (HashTable *addrs, void *addr) +static void checkAddress (HashTable *addrs, const void *addr) { ObjectCode *oc; int i; @@ -73,7 +73,7 @@ static void searchStackChunk (HashTable *addrs, StgPtr sp, StgPtr stack_end) switch (info->i.type) { case RET_SMALL: case RET_BIG: - checkAddress(addrs, (void*)info); + checkAddress(addrs, (const void*)info); break; default: @@ -88,7 +88,7 @@ static void searchStackChunk (HashTable *addrs, StgPtr sp, StgPtr stack_end) static void searchHeapBlocks (HashTable *addrs, bdescr *bd) { StgPtr p; - StgInfoTable *info; + const StgInfoTable *info; uint32_t size; rtsBool prim; |