From 7814cd5bb0d145c4d83d7566885bdc3992b63d0c Mon Sep 17 00:00:00 2001 From: David Eichmann Date: Fri, 6 Nov 2020 16:01:33 +0000 Subject: ghc-heap: expose decoding from heap representation Co-authored-by: Sven Tennie Co-authored-by: Matthew Pickering Co-authored-by: Ben Gamari --- includes/rts/storage/Heap.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'includes/rts') 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[]); -- cgit v1.2.1