From c519f24319c3296bda7d3ed53c53e9b09398dad5 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 6 Oct 2013 21:31:52 -0700 Subject: More clarity on CurrentAlloc docs. Signed-off-by: Edward Z. Yang --- rts/sm/Storage.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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; -- cgit v1.2.1