On 13/01/14 13:25, g...@git.haskell.org wrote:
Repository : ssh://g...@git.haskell.org/integer-gmp

On branch  : master
Link       : 
http://ghc.haskell.org/trac/ghc/changeset/7bdcadda7e884edffb1427f0685493f3a2e5c5fa/integer-gmp

---------------------------------------------------------------

commit 7bdcadda7e884edffb1427f0685493f3a2e5c5fa
Author: Herbert Valerio Riedel <h...@gnu.org>
Date:   Thu Jan 9 00:19:31 2014 +0100

     Allocate initial 1-limb mpz_t on the Stack and introduce MPZ# type

     We now allocate a 1-limb mpz_t on the stack instead of doing a more
     expensive heap-allocation (especially if the heap-allocated copy becomes
     garbage right away); this addresses #8647.

While this is quite cool (turning some J# back into S#), I don't understand why you've done it this way. Couldn't it be done in the Haskell layer rather than modifying the primops? The ByteArray# has already been allocated by GMP, so you don't lose anything by returning it to Haskell and checking the size there. Then all the DUMMY_BYTEARRAY stuff would go away.

Cheers,
Simon

_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs

Reply via email to