Question about allocaArray and friends

In C, if you try to "alloca" too much memory, then the stack gets overwritten and bad things happen. Does GHC exhibit the same behavior with allocaArray and the like? Is there a way to find out how much is safe to allocate? Thanks in advance for the help, Patrick

Hello Patrick, Friday, January 23, 2009, 1:22:21 AM, you wrote:
In C, if you try to "alloca" too much memory, then the stack gets overwritten and bad things happen. Does GHC exhibit the same behavior with allocaArray and the like? Is there a way to find out how much is safe to allocate?
alloca allocs memory in heap, so it should be safe if you are not going to allocate lots of megabytes. you can use usual binary division algorithm to find how much you can allocate -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (2)
-
Bulat Ziganshin
-
Patrick Perry