I am not sure if you can't use them for some reason, but this sounds
like exactly the problem that stable pointers are meant to solve:
http://haskell.org/ghc/docs/latest/html/libraries/base/Foreign-StablePtr.html
John
--
John Meacham - ⑆repetae.net⑆john⑈