The FFI libraries currently contain support for explicit allocation and deallocation via the malloc/free family and support for implicit allocation and deallocation via alloca and friends. But there is a very useful level between these extremes: Pooled memory management. Under this scheme, (re-)allocations belong to a given pool, and everything in a pool is deallocated when the pool itself is deallocated.
You can find the implementation and the (lean) docs at: http://haskell.org/HOpenGL/PoolRFC/Pool.hs http://haskell.org/HOpenGL/PoolRFC/html/Foreign.Marshal.Pool.html I propose adding this module to FFI addendum and the exports of module Foreign.Marshal. Although the module is definitely not a candidate for the next ACM award, it's a useful and common abstraction which can easily be implemented on the existing FFI modules. Comments? Cheers, S. _______________________________________________ FFI mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/ffi