[commit: ghc] master: Use canned heap checks to save a few bytes of code (2471a6b)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/2471a6bacccdf4d187aa4b31c382d5a5094b6fa5

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

commit 2471a6bacccdf4d187aa4b31c382d5a5094b6fa5
Author: Simon Marlow <[email protected]>
Date:   Tue Oct 23 09:45:05 2012 +0100

    Use canned heap checks to save a few bytes of code

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

 includes/Cmm.h  |    3 +++
 rts/PrimOps.cmm |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/includes/Cmm.h b/includes/Cmm.h
index 9cb2dbc..2b5d93b 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -381,6 +381,9 @@
     TICK_ALLOC_PRIM(SIZEOF_StgHeader,bytes-SIZEOF_StgHeader,0); \
     CCCS_ALLOC(bytes);
 
+#define ALLOC_PRIM_(bytes,fun)                                  \
+    ALLOC_PRIM_WITH_CUSTOM_FAILURE(bytes,GC_PRIM(fun));
+
 #define ALLOC_PRIM_P(bytes,fun,arg)                             \
     ALLOC_PRIM_WITH_CUSTOM_FAILURE(bytes,GC_PRIM_P(fun,arg));
 
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 6cba3f5..993088a 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -252,7 +252,7 @@ stg_newMutVarzh ( gcptr init )
 {
     W_ mv;
 
-    ALLOC_PRIM (SIZEOF_StgMutVar);
+    ALLOC_PRIM_P (SIZEOF_StgMutVar, stg_newMutVarzh, init);
 
     mv = Hp - SIZEOF_StgMutVar + WDS(1);
     SET_HDR(mv,stg_MUT_VAR_DIRTY_info,CCCS);
@@ -1154,7 +1154,7 @@ stg_newMVarzh ()
 {
     W_ mvar;
 
-    ALLOC_PRIM (SIZEOF_StgMVar);
+    ALLOC_PRIM_ (SIZEOF_StgMVar, stg_newMVarzh);
   
     mvar = Hp - SIZEOF_StgMVar + WDS(1);
     SET_HDR(mvar,stg_MVAR_DIRTY_info,CCCS);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.