[commit: ghc] master: rts: Reuse dbl_link_remove in a few places (455477a)

git at git.haskell.org git at git.haskell.org
Tue Jun 5 14:02:07 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/455477a3675c53ce186b3e75ec88f5488fec792c/ghc

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

commit 455477a3675c53ce186b3e75ec88f5488fec792c
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Tue Jun 5 17:01:12 2018 +0300

    rts: Reuse dbl_link_remove in a few places
    
    Test Plan: this validates
    
    Reviewers: simonmar, bgamari, erikd
    
    Reviewed By: simonmar
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4795


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

455477a3675c53ce186b3e75ec88f5488fec792c
 rts/sm/Evac.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
index 3415a4a..deaad27 100644
--- a/rts/sm/Evac.c
+++ b/rts/sm/Evac.c
@@ -278,14 +278,7 @@ evacuate_large(StgPtr p)
   }
 
   // remove from large_object list
-  if (bd->u.back) {
-    bd->u.back->link = bd->link;
-  } else { // first object in the list
-    gen->large_objects = bd->link;
-  }
-  if (bd->link) {
-    bd->link->u.back = bd->u.back;
-  }
+  dbl_link_remove(bd, &gen->large_objects);
 
   /* link it on to the evacuated large object list of the destination gen
    */
@@ -414,14 +407,7 @@ evacuate_compact (StgPtr p)
     }
 
     // remove from compact_objects list
-    if (bd->u.back) {
-        bd->u.back->link = bd->link;
-    } else { // first object in the list
-        gen->compact_objects = bd->link;
-    }
-    if (bd->link) {
-        bd->link->u.back = bd->u.back;
-    }
+    dbl_link_remove(bd, &gen->compact_objects);
 
     /* link it on to the evacuated compact object list of the destination gen
      */



More information about the ghc-commits mailing list