#4902: Create a primop for getting the size of an Array#
---------------------------------+------------------------------------------
    Reporter:  tibbe             |       Owner:                
        Type:  feature request   |      Status:  new           
    Priority:  normal            |   Component:  Runtime System
     Version:  7.0.1             |    Keywords:                
    Testcase:                    |   Blockedby:                
          Os:  Unknown/Multiple  |    Blocking:                
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown  
---------------------------------+------------------------------------------
 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#`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4902>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to