[commit: ghc] master: Convert more RTS macros to functions (c88fe39)

Ian Lynagh <[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/c88fe3975a19a6ff33bda2db1da1c424625e2223

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

commit c88fe3975a19a6ff33bda2db1da1c424625e2223
Author: Ian Lynagh <[email protected]>
Date:   Fri Sep 21 18:36:27 2012 +0100

    Convert more RTS macros to functions
    
    Object sizes still unchanged.

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

 includes/rts/storage/ClosureMacros.h |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h
index 8f071a2..849a6ef 100644
--- a/includes/rts/storage/ClosureMacros.h
+++ b/includes/rts/storage/ClosureMacros.h
@@ -177,16 +177,22 @@ STATIC_LINK(const StgInfoTable *info, StgClosure *p)
     }
 }
 
-#define STATIC_LINK2(info,p)							\
-   (*(StgClosure**)(&((p)->payload[info->layout.payload.ptrs +			\
-					info->layout.payload.nptrs + 1])))
+INLINE_HEADER StgClosure *STATIC_LINK2(const StgInfoTable *info,
+                                       StgClosure *p) {
+    return (*(StgClosure**)(&((p)->payload[info->layout.payload.ptrs +
+                            info->layout.payload.nptrs + 1])));
+}
 
 /* -----------------------------------------------------------------------------
    INTLIKE and CHARLIKE closures.
    -------------------------------------------------------------------------- */
 
-#define CHARLIKE_CLOSURE(n) ((P_)&stg_CHARLIKE_closure[(n)-MIN_CHARLIKE])
-#define INTLIKE_CLOSURE(n)  ((P_)&stg_INTLIKE_closure[(n)-MIN_INTLIKE])
+INLINE_HEADER P_ CHARLIKE_CLOSURE(int n) {
+    return (P_)&stg_CHARLIKE_closure[(n)-MIN_CHARLIKE];
+}
+INLINE_HEADER P_ INTLIKE_CLOSURE(int n) {
+    return (P_)&stg_INTLIKE_closure[(n)-MIN_INTLIKE];
+}
 
 /* ----------------------------------------------------------------------------
    Macros for untagging and retagging closure pointers
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.