Branko Čibej wrote:
Graham Leggett wrote:
I expect that with the new detached global pools in APR, that particular
problem would never have arisen.
Right, that was the point, and that allows the pools
to behave more or less like malloc/free.
One thing I've proposed (but was vetoed) was the actual
malloc/free programmable replacement within the allocator.
Now the thing to consider is to make the allocator public
allowing to implement what ever system memory allocation
there is (eg, heap or virtualmemory on win32, shm, etc)
instead just relying on standard allocator implementation
which (I presume that 8K granulation was more or less
empirically determined) is fixed.
The fact remains that control of pool lifetimes, whether in combination
with DSO or long-lived memory structures, is a tricky problem not
addressed by the current implementation.
Detached pools behave like malloc/free and have to be
destroyed manually (well you can always create a pool
cleanup from some standard pool).
Having custom allocators one could even create
smaller (less then default 8K) memory
footprint where system malloc has low fragmentation and
larger number of small pools is required.
Regards
--
^(TM)