[commit: ghc] master: More clarity on CurrentAlloc docs. (c519f24)

git at git.haskell.org git
Mon Oct 7 04:32:16 UTC 2013


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

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

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

commit c519f24319c3296bda7d3ed53c53e9b09398dad5
Author: Edward Z. Yang <ezyang at mit.edu>
Date:   Sun Oct 6 21:31:52 2013 -0700

    More clarity on CurrentAlloc docs.
    
    Signed-off-by: Edward Z. Yang <ezyang at mit.edu>


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

c519f24319c3296bda7d3ed53c53e9b09398dad5
 rts/sm/Storage.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index db834e6..d419714 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -706,6 +706,28 @@ allocate (Capability *cap, W_ n)
             // we have a block in the nursery: take it and put
             // it at the *front* of the nursery list, and use it
             // to allocate() from.
+            //
+            // Previously the nursery looked like this:
+            //
+            //           CurrentNursery
+            //                  /
+            //                +-+    +-+
+            // nursery -> ... |A| -> |B| -> ...
+            //                +-+    +-+
+            //
+            // After doing this, it looks like this:
+            //
+            //                      CurrentNursery
+            //                            /
+            //            +-+           +-+
+            // nursery -> |B| -> ... -> |A| -> ...
+            //            +-+           +-+
+            //             \
+            //              CurrentAlloc
+            //
+            // The point is to get the block out of the way of the
+            // advancing CurrentNursery pointer, while keeping it
+            // on the nursery list so we don't lose track of it.
             cap->r.rCurrentNursery->link = bd->link;
             if (bd->link != NULL) {
                 bd->link->u.back = cap->r.rCurrentNursery;




More information about the ghc-commits mailing list