Changes between Version 10 and Version 11 of ReplacingGMPNotes
 Timestamp:
 Aug 3, 2006 4:09:45 AM (9 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

ReplacingGMPNotes
v10 v11 26 26 2. Memory Structure; Simultaneous Access to GMP by Foreign (C) code in the Same Binary 27 27 28 In the current GMP implementation, GMP is configured to use GHC's GC memory, so any single binary containing Haskell code compiled with GHC contains the RTS and GMP. C code in the same binary as GHCcompiled Haskell code cannot access GMP separately due to duplicatesymbols f or GMP function namesin both programs. This problem was noted in [http://hackage.haskell.org/trac/ghc/ticket/311 bug Ticket #311]. Simon PeytonJones suggested that a simple renaming of GHCGMP functions would solve this problem and Bulat Ziganshin suggested simply using an automated tool to do this. See [http://www.haskell.org/pipermail/glasgowhaskellusers/2006August/010679.html Replacement for GMP].28 In the current GMP implementation, GMP is configured to use GHC's GC memory, so any single binary containing Haskell code compiled with GHC contains the RTS and GMP. C code in the same binary as GHCcompiled Haskell code cannot access GMP separately due to duplicatesymbols from GMP in both programs. This problem was noted in [http://hackage.haskell.org/trac/ghc/ticket/311 bug Ticket #311]. Simon PeytonJones suggested that a simple renaming of GHCGMP functions would solve this problem and Bulat Ziganshin suggested simply using an automated tool to do this. See [http://www.haskell.org/pipermail/glasgowhaskellusers/2006August/010679.html Replacement for GMP]. 29 29 30 30 GHC does not have a custommodified version of GMP (in fact, GHC uses the system build of GMP if that is available). The custommemory configuration of GMP uses GMP's [http://swox.com/gmp/manual/CustomAllocation.html#CustomAllocation Custom Allocation] routines. Alternative libraries may not have this facility built in.