summaryrefslogtreecommitdiff
path: root/rts/ProfHeap.c
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2020-04-10 02:36:24 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-14 23:31:01 -0400
commit15fa9bd6dd2d0b8d1fcd7135c85ea0d60853340d (patch)
treea171110ed89c9df0cb0f6bc5884b9e9353c26d7c /rts/ProfHeap.c
parent41230e2601703df0233860be3f7d53f3a01bdbe5 (diff)
downloadhaskell-15fa9bd6dd2d0b8d1fcd7135c85ea0d60853340d.tar.gz
rts: Expand and add more notes regarding slop
Diffstat (limited to 'rts/ProfHeap.c')
-rw-r--r--rts/ProfHeap.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 6c26de1699..26f4de468d 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -1275,8 +1275,21 @@ heapCensusChain( Census *census, bdescr *bd )
heapProfObject(census,(StgClosure*)p,size,prim);
p += size;
- /* skip over slop */
- while (p < bd->free && !*p) p++; // skip slop
+
+ /* skip over slop, see Note [slop on the heap] */
+ while (p < bd->free && !*p) p++;
+ /* Note [skipping slop in the heap profiler]
+ *
+ * We make sure to zero slop that can remain after a major GC so
+ * here we can assume any slop words we see until the block's free
+ * pointer are zero. Since info pointers are always nonzero we can
+ * use this to scan for the next valid heap closure.
+ *
+ * Note that not all types of slop are relevant here, only the ones
+ * that can reman after major GC. So essentially just large objects
+ * and pinned objects. All other closures will have been packed nice
+ * and thight into fresh blocks.
+ */
}
}
}