[commit: ghc] wip/erikd/remove-nat: rts: Specialize `overwritingClosure` for `MSG_THROWTO` (d755a3f)

git at git.haskell.org git at git.haskell.org
Wed May 4 10:21:28 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/erikd/remove-nat
Link       : http://ghc.haskell.org/trac/ghc/changeset/d755a3f1508ad439f95abe38b63f4652d879add0/ghc

>---------------------------------------------------------------

commit d755a3f1508ad439f95abe38b63f4652d879add0
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Tue May 3 21:13:17 2016 +1000

    rts: Specialize `overwritingClosure` for `MSG_THROWTO`
    
    The function `executeMessage` replaces the `header.info` pointer with
    a `WHITEHOLE` passes it to `throwToMsg` and then passes it to
    `doneWithMsgThrowTo` which calls `overwritingClosure` on it. However,
    `overwritingClosure` needs to know the size of the closure which is
    based on the `header.info` pointer. Unfortunately, the `header.info`
    pointer can't be reset to `MSG_THROWTO` or it might cause race
    conditions.
    
    The solution suggested by Simon Marlow is to add and use a function
    `overwritingClosureWithSize` that takes an explicit size parameter.


>---------------------------------------------------------------

d755a3f1508ad439f95abe38b63f4652d879add0
 includes/rts/storage/ClosureMacros.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h
index 9246fc6..73b9767 100644
--- a/includes/rts/storage/ClosureMacros.h
+++ b/includes/rts/storage/ClosureMacros.h
@@ -510,10 +510,10 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n)
 void LDV_recordDead (StgClosure *c, uint32_t size);
 #endif
 
-EXTERN_INLINE void overwritingClosureWithSize (StgClosure *p, nat size);
-EXTERN_INLINE void overwritingClosureWithSize (StgClosure *p, nat size)
+EXTERN_INLINE void overwritingClosureWithSize (StgClosure *p, uint32_t size);
+EXTERN_INLINE void overwritingClosureWithSize (StgClosure *p, uint32_t size)
 {
-    nat i;
+    uint32_t i;
 
 #if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK
     // see Note [zeroing slop], also #8402



More information about the ghc-commits mailing list