[Haskell-cafe] FFI: how to allocate a const char * from haskell

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Tue Apr 18 13:44:43 UTC 2023


> If I had to guess, what is happening is that the structure holder uses name
> without copying it under the hood, so that name is freed but some later method
> depends on that field being available.

you are right

I just red the doc of mallocByte and it seems that under the hood it use the c malloc method.
So at first I will check that the program does not segfault with a malloced array or char

thanks

Fred


More information about the Haskell-Cafe mailing list