Replacement for GMP: Update
simonpj at microsoft.com
Thu Aug 10 13:00:39 EDT 2006
[Narrowing to GHC hackers plus Esa]
| It would be easy to change the definition of OPENSSL_malloc to call
| RTS-memory as necessary. It would be more efficient for BN to be
| garbage collected (these bignum libraries allocate and delete a lot
| of small memory blocks (~1-2KB for large integers)). Since
| ForeignPtr is simply too slow I am bringing BN value allocations into
| the rts as close as possible to how you did it with GMP.
OK so you are talking of taking a copy of the BN code, changing the
function names, and statically linking its allocator to GHC's RTS.
If someone wants to make a program that uses BN for some other purpose,
they get the original BN, whose function names don't clash, and which
Sounds ok to me.
| > Making a single word contain either a pointer or a non-pointer
| > (depending on the setting of some bit) would have some quite global
| > implications, as would losing 32 bit precision from Int#. I suggest
| > that you do not couple these two projects together! Do the GMP
| > first, then investigate this later. We have quite a few
| > ideas that we have never followed up.
| The original idea was to create a specialized Int30# for that
| purpose. In any case implementing it would certainly make my
| intended job--getting this done in time for the next release--a bit
| more difficult.
| Best regards,
More information about the Cvs-ghc