summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@mit.edu>2013-10-06 21:31:52 -0700
committerEdward Z. Yang <ezyang@mit.edu>2013-10-06 21:31:52 -0700
commitc519f24319c3296bda7d3ed53c53e9b09398dad5 (patch)
tree660d903ea34b2f90e8fcea209eae4af728de7e59
parent3e0109b302bbd9f849d71cbc3efcc905d5271e4e (diff)
downloadhaskell-c519f24319c3296bda7d3ed53c53e9b09398dad5.tar.gz
More clarity on CurrentAlloc docs.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
-rw-r--r--rts/sm/Storage.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index db834e6279..d419714e93 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;