
7 Aug
2008
7 Aug
'08
2:36 a.m.
On Thu, 7 Aug 2008, Bulat Ziganshin wrote:
Hello Vasili,
Thursday, August 7, 2008, 9:33:32 AM, you wrote:
oh, it was my mistake. alloca behavior is completely defined by it's generic implementation:
allocaBytes :: Int -> (Ptr a -> IO b) -> IO b allocaBytes size = bracket (mallocBytes size) free
although GHC implementation is much more efficient
That is, it is not a good idea to use 'allocaBytes n return' in order to carry a pointer of an allocated piece of memory out of the inner action.