[commit: ghc] wip/gc/misc-rts, wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: rts/GC: Refactor gcCAFs (7d7b866)

git at git.haskell.org git at git.haskell.org
Thu Feb 21 15:12:00 UTC 2019


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

On branches: wip/gc/misc-rts,wip/gc/nonmoving-nonconcurrent,wip/gc/preparation
Link       : http://ghc.haskell.org/trac/ghc/changeset/7d7b866c63b04dc2e2fcf655c043160acbb8f6b4/ghc

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

commit 7d7b866c63b04dc2e2fcf655c043160acbb8f6b4
Author: Ben Gamari <ben at well-typed.com>
Date:   Tue Feb 5 21:17:36 2019 -0500

    rts/GC: Refactor gcCAFs


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

7d7b866c63b04dc2e2fcf655c043160acbb8f6b4
 rts/sm/GC.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 70d6d8e..0bb7809 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -1836,21 +1836,16 @@ resize_nursery (void)
 
 #if defined(DEBUG)
 
-static void gcCAFs(void)
+void gcCAFs(void)
 {
-    StgIndStatic *p, *prev;
+    uint32_t i = 0;
+    StgIndStatic *prev = NULL;
 
-    const StgInfoTable *info;
-    uint32_t i;
-
-    i = 0;
-    p = debug_caf_list;
-    prev = NULL;
-
-    for (p = debug_caf_list; p != (StgIndStatic*)END_OF_CAF_LIST;
-         p = (StgIndStatic*)p->saved_info) {
-
-        info = get_itbl((StgClosure*)p);
+    for (StgIndStatic *p = debug_caf_list;
+         p != (StgIndStatic*) END_OF_CAF_LIST;
+         p = (StgIndStatic*) p->saved_info)
+    {
+        const StgInfoTable *info = get_itbl((StgClosure*)p);
         ASSERT(info->type == IND_STATIC);
 
         // See Note [STATIC_LINK fields] in Storage.h



More information about the ghc-commits mailing list