summaryrefslogtreecommitdiff
path: root/rts/Printer.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2018-06-19 17:10:55 -0400
committerBen Gamari <ben@smart-cactus.org>2018-06-19 20:15:46 -0400
commit436c0e9b5e201b9121e4b48a7351dd42800eb7f3 (patch)
treee3f4609a07cd286d9be70e7011a0f5f5c0c95af3 /rts/Printer.c
parenta5eaa0f9371df8ca0c733ffe56fc1eb59d8ad6a4 (diff)
downloadhaskell-436c0e9b5e201b9121e4b48a7351dd42800eb7f3.tar.gz
findPtr: don't search the nursery
Test Plan: Used it in anger Reviewers: bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4873
Diffstat (limited to 'rts/Printer.c')
-rw-r--r--rts/Printer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/rts/Printer.c b/rts/Printer.c
index 4019ef1710..291f529e8f 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -13,6 +13,7 @@
#include "rts/Bytecodes.h" /* for InstrPtr */
#include "sm/Storage.h"
+#include "sm/GCThread.h"
#include "Hash.h"
#include "Printer.h"
#include "RtsUtils.h"
@@ -825,11 +826,16 @@ findPtr(P_ p, int follow)
int i = 0;
searched = 0;
+#if 0
+ // We can't search the nursery, because we don't know which blocks contain
+ // valid data, because the bd->free pointers in the nursery are only reset
+ // just before a block is used.
for (n = 0; n < n_capabilities; n++) {
bd = nurseries[i].blocks;
i = findPtrBlocks(p,bd,arr,arr_size,i);
if (i >= arr_size) return;
}
+#endif
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
bd = generations[g].blocks;
@@ -837,6 +843,13 @@ findPtr(P_ p, int follow)
bd = generations[g].large_objects;
i = findPtrBlocks(p,bd,arr,arr_size,i);
if (i >= arr_size) return;
+ for (n = 0; n < n_capabilities; n++) {
+ i = findPtrBlocks(p, gc_threads[n]->gens[g].part_list,
+ arr, arr_size, i);
+ i = findPtrBlocks(p, gc_threads[n]->gens[g].todo_bd,
+ arr, arr_size, i);
+ }
+ if (i >= arr_size) return;
}
if (follow && i == 1) {
debugBelch("-->\n");