Ticket #4902 (closed feature request: fixed)
Create a primop for getting the size of an Array#
Description
We currently store the size of Array#s (and MutableArray#s):
typedef struct {
StgHeader header;
StgWord ptrs;
StgWord size; // ptrs plus card table
StgClosure *payload[FLEXIBLE_ARRAY];
// see also: StgMutArrPtrs macros in ClosureMacros.h
} StgMutArrPtrs;
However, there's currently no way to read this information. This means that array types defined in terms of the two primitive array types need to store this size, even though it's already stored by GHC.
I think we should expose sizeOfArray# and sizeOfMutableArray#.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

