Create a primop for getting the size of an Array#
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#
.
Trac metadata
Trac field | Value |
---|---|
Version | 7.0.1 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Runtime System |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |