mallocForeignPtr vs. C

Evan Laforge qdunkan at gmail.com
Mon Jul 12 16:43:45 EDT 2010


> The easiest thing to do is copy the contents to a regular area of memory not
> managed by a Storable Vector.  This'll be much less painful because it's just a
> normal free (not a recursive one, which can get hairy).

Yeah, that's definitely the safest and simplest.  But the copying
defeats the purpose of passing a pointer in the first place, which was
to not have to copy the giant array just to pass it.


More information about the Glasgow-haskell-users mailing list