summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-08-04 10:28:11 -0400
committerBen Gamari <ben@smart-cactus.org>2021-08-05 11:04:51 -0400
commit9122a7d09d9dc8858cd593d4a39642d8837719f4 (patch)
tree2984c0925c21cee4bacdb2862b0624ce424943c7 /includes
parent657ae4bfd7a6b65d9ad091f4d0305d66548810a3 (diff)
downloadhaskell-wip/T20199.tar.gz
rts: Fix use of sized array in Heap.hwip/T20199
Sized arrays cannot be used in headers that might be imported from C++. Fixes #20199.
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/storage/Heap.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/rts/storage/Heap.h b/includes/rts/storage/Heap.h
index b950df76e5..b3b1efaf9f 100644
--- a/includes/rts/storage/Heap.h
+++ b/includes/rts/storage/Heap.h
@@ -18,10 +18,14 @@ void heap_view_closure_ptrs_in_pap_payload(StgClosure *ptrs[], StgWord *nptrs
StgWord heap_view_closureSize(StgClosure *closure);
/*
- * Collect the pointers of a closure into the given array. `size` should be
+ * Collect the pointers of a closure into the given array. The given array 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`.
+ *
+ * In principle this is
+ * StgWord collect_pointers(StgClosure *closure, StgWord size, StgClosure *ptrs[size]);
+ * but we cannot write this and retain C++ compatibility.
*/
-StgWord collect_pointers(StgClosure *closure, StgWord size, StgClosure *ptrs[size]);
+StgWord collect_pointers(StgClosure *closure, StgClosure *ptrs[]);