[Haskell-cafe] Question about allocaArray and friends
Bulat Ziganshin
bulat.ziganshin at gmail.com
Thu Jan 22 17:33:08 EST 2009
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 at gmail.com
More information about the Haskell-Cafe
mailing list