[GHC] #5210: Add primops for copying/cloning byte arrays

GHC cvs-ghc at haskell.org
Tue May 24 00:12:04 CEST 2011


#5210: Add primops for copying/cloning byte arrays
---------------------------------+------------------------------------------
    Reporter:  tibbe             |       Owner:  tibbe       
        Type:  feature request   |      Status:  patch       
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.3             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
Changes (by tibbe):

  * status:  new => patch
  * type:  bug => feature request


Comment:

 The attached patches add two new primops: `copyByteArray#` and
 `copyMutableByteArray#`. I didn't any primops corresponding to the clone
 primops we have for `Array#` and `MutableArray#`. Since `newByteArray#`
 and its cousins don't initialize the newly created array it should be
 efficient enough to implement clone as a call to `newByteArray#`, followed
 by a call to `copyByteArray#`.

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



More information about the Glasgow-haskell-bugs mailing list