Simon Peyton-Jones wrote:
>
> | AFAIK, the GC never runs during foreign calls. This, combine with the
> fact that GHC can | pass ByteArray# directly to FFI calls, should make
> memcpy safe even for unpinned | byte arrays. At least that's how I
> understand it.
>
> Unless I am much mistaken, GC absolutely does run during *safe* foreign
> calls, as do other Haskell threads and all manner of other stuff.
> ("Unsafe" ones are supposed to run fast, and no gc is allowed. We think
> of unsafe foreign calls as "fat machine instructions".)
I don't think the GC can run even during a safe foreign call while the
thread is in foreign code. It's only when the foreign code calls back into
Haskell that allocation and hence synchronised GC can happen.
Roman
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc