return words;
}
+// Return an accurate count of the live data in the heap, excluding
+// generation 0.
lnat
calcLiveWords(void)
{
live = 0;
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
for (s = 0; s < generations[g].n_steps; s++) {
- /* approximate amount of live data (doesn't take into account slop
- * at end of each block).
- */
if (g == 0 && s == 0) continue;
stp = &generations[g].steps[s];
live += countOccupied(stp->blocks) +
generations[g].steps[0].n_large_blocks
> generations[g].max_blocks
&& stp->is_compacted == 0) {
- needed += 2 * stp->n_blocks;
+ needed += 2 * stp->n_blocks + stp->n_large_blocks;
} else {
- needed += stp->n_blocks;
+ needed += stp->n_blocks + stp->n_large_blocks;
}
}
}