summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDavid Eichmann <EichmannD@gmail.com>2020-11-06 16:01:33 +0000
committerDavid Eichmann <EichmannD@gmail.com>2020-11-06 17:59:13 +0000
commit4de4be2be940dba84f50abd91a67d78fc4615634 (patch)
tree0ad898f9a8493bff88bb862834d989d524a67ed4 /includes
parentb1d2c1f3246b3740589a59bdf7648c13de47c32b (diff)
downloadhaskell-wip/ghc-debug_getClosureFromHeapRep.tar.gz
ghc-heap: expose decoding from heap representationwip/ghc-debug_getClosureFromHeapRep
Co-authored-by: Sven Tennie <sven.tennie@gmail.com> Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com> Co-authored-by: Ben Gamari <bgamari.foss@gmail.com>
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/storage/Heap.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/includes/rts/storage/Heap.h b/includes/rts/storage/Heap.h
index 2e908279bf..7a35941656 100644
--- a/includes/rts/storage/Heap.h
+++ b/includes/rts/storage/Heap.h
@@ -16,3 +16,12 @@ void heap_view_closure_ptrs_in_pap_payload(StgClosure *ptrs[], StgWord *nptrs
, StgClosure *fun, StgClosure **payload, StgWord size);
StgWord heap_view_closureSize(StgClosure *closure);
+
+/*
+ * Collect the pointers of a closure into the given array. `size` should be
+ * large enough to hold all collected pointers e.g.
+ * `heap_view_closureSize(closure)`. Returns the number of pointers collected.
+ * The caller must ensure that `closure` is not modified (or moved by the GC)
+ * for the duration of the call to `collect_pointers`.
+ */
+StgWord collect_pointers(StgClosure *closure, StgWord size, StgClosure *ptrs[]);