[project @ 2005-06-06 08:49:07 by tharris]
[ghc-hetmet.git] / ghc / includes / Cmm.h
index e4f44d6..415dc4c 100644 (file)
    HP_CHK_GEN(alloc,liveness,reentry);                 \
    TICK_ALLOC_HEAP_NOCTR(alloc);
 
+// allocateLocal() allocates from the nursery, so we check to see
+// whether the nursery is nearly empty in any function that uses
+// allocateLocal() - this includes many of the primops.
 #define MAYBE_GC(liveness,reentry)                     \
-   if (CInt[alloc_blocks] >= CInt[alloc_blocks_lim]) { \
+   if (bdescr_link(CurrentNursery) == NULL) {          \
        R9  = liveness;                                 \
         R10 = reentry;                                 \
         jump stg_gc_gen_hp;                            \
  */
         
 #define StgFunInfoExtra_slow_apply(fun_info)    \
-        (StgFunInfoExtraRev_slow_apply_offset(fun_info)    \
-        + (fun_info) + SIZEOF_StgFunInfoExtraRev + SIZEOF_StgInfoTable)
+        (TO_W_(StgFunInfoExtraRev_slow_apply_offset(fun_info))    \
+               + (fun_info) + SIZEOF_StgFunInfoExtraRev + SIZEOF_StgInfoTable)
 
 #define StgFunInfoExtra_fun_type(i)   StgFunInfoExtraRev_fun_type(i)
 #define StgFunInfoExtra_arity(i)      StgFunInfoExtraRev_arity(i)
     TICK_BUMP(ALLOC_HEAP_ctr);                 \
     TICK_BUMP_BY(ALLOC_HEAP_tot,n)
 
+/* -----------------------------------------------------------------------------
+   Misc junk
+   -------------------------------------------------------------------------- */
+
+#define TICK_MILLISECS   (1000/TICK_FREQUENCY)   /* ms per tick */
+
 #endif /* CMM_H */