mbw 2017-03-04 20:04:11
Hello, I have another question about the FFI. According to https://ghc.readthedocs.io/en/8.0.1/ffi-chap.html#memory-allocation, among the functions in Foreign.Marshall.Alloc, alloca should be used when possible. However, the documentation on this (and similar functions like allocaArray) is not really exhaustive. Does alloca have anything to do with alloca from ? If so, can I assume it is not
mbw 2017-03-04 20:04:17
portable and I an blow out the stack?
mbw 2017-03-04 20:04:38
*can
cocreature 2017-03-04 20:31:34
mbw: afaik it has nothing to do with alloca.h. it allocates on the heap and is portable
cocreature 2017-03-04 20:31:56
but I might be wrong here
mbw 2017-03-04 20:32:51
I tried it with 5000 doubles, which should've given some indication if it really was using alloca.
mbw 2017-03-04 20:33:51
oh wait
mbw 2017-03-04 20:35:04
That's only 39kb. Still, it should be easily checkable if I go over 8192kb.
mbw 2017-03-04 20:35:42
At least that's the stack size limit on my machine
mbw 2017-03-04 20:36:03
But probably, if this function was in any way dangerous, there would probably be a warning.
glguy 2017-03-04 20:37:56
alloca from C is different from GHC
recur22 2017-03-04 20:42:14
why every haskell library has to be special and has its own unique DSL?
recur22 2017-03-04 20:43:24
unnecessary monadic