On Wed, Jan 26, 2011 at 11:57 AM, Simon Peyton-Jones <[email protected]> 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 think we can get away with using an unsafe call for memcpy as it's not blocking and pretty fast. Johan _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
