GHCI/FFI/GMP/Me madness

Abraham Egnor abe.egnor at gmail.com
Mon Aug 9 14:24:21 EDT 2004


Ah, that triggers the bug for me as well.  Oddly, calling
System.Mem.performGC once isn't enough, but twice is:

Ok, modules loaded: Main.
*Main> mpz_new
*Main> System.Mem.performGC
*Main> str_test
1

vs.

Ok, modules loaded: Main.
*Main> mpz_new
*Main> System.Mem.performGC
*Main> System.Mem.performGC
*Main> str_test
139406720

On Mon, 9 Aug 2004 19:36:37 +0200, Remi Turk <buran at xs4all.nl> wrote:
> On Mon, Aug 09, 2004 at 01:09:40PM -0400, Abraham Egnor wrote:
> > FWIW, I couldn't reproduce this problem on my system (i.e. str_test
> > always printed "1").  GHC 6.2.1, libgmp 4.1.3, debian unstable
> >
> > Abe
> 
> Same versions here, on an old heavily-patched/FUBAR rock linux
> 1.4 system.
> 
> Does the following make any difference? (trying to cause GCing)
> 
> Haskell/Mpz/weird% make
> ghci util.o -#include util.h PrimMpz.hs
>    ___         ___ _
>   / _ \ /\  /\/ __(_)
>  / /_\// /_/ / /  | |      GHC Interactive, version 6.2.1, for Haskell 98.
> / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
> \____/\/ /_/\____/|_|      Type :? for help.
> 
> Loading package base ... linking ... done.
> Loading object (static) util.o ... done
> final link ... done
> Compiling Main             ( PrimMpz.hs, interpreted )
> Ok, modules loaded: Main.
> *Main> mpz_new
> *Main> sum (replicate (200*1000) 0)
> 0
> *Main> str_test
> 1076535944
> *Main>
> 
> Groeten,
> Remi
> 
> 
> 
> --
> Nobody can be exactly like me. Even I have trouble doing it.
>


More information about the Glasgow-haskell-users mailing list