Proposal: Pooled memory management

Sven Panne Sven.Panne at
Sat Jan 18 08:22:32 EST 2003

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

You can find the implementation and the (lean) docs at:

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.



More information about the FFI mailing list