[Haskell-iPhone] Automatically freeing function pointers

David Pollak feeder.of.the.bears at gmail.com
Sat Jun 18 01:29:06 CEST 2011


Howdy,

I tried to build a function that would create an auto-freeing function
pointer:

runOnMain :: IO () -> IO ()
runOnMain todo = do
                  func <- funky
                  dispatchFunc func
  where funky =  mkStrCB $ \v -> do
                                   todo
                                   func <- funky
                                   freeHaskellFunPtr func

Unfortunately, I wind up getting:
 internal error: iPhoneCreateAdjustor - adjustor pool 'Main_d2K2' is empty
(capacity 32)
    (GHC version 6.10.4-iphone-simulator for i386_apple_darwin)

I'm not sure why, but I suspect that funky is being called recursively and
thus stuff is never being freed.

Any hints as to the issue and solutions?

Thanks,

David


-- 
Lift, the simply functional web framework http://liftweb.net
Simply Lift http://simply.liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/iphone/attachments/20110617/5d109383/attachment.htm>


More information about the iPhone mailing list