You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Sander Striker <st...@apache.org> on 2001/12/07 09:40:32 UTC

Memory initialization question

Hi,

Why are apr_pool_alloc_init()/apr_pool_alloc_term() and
apr_initialize()/apr_terminate() not symmetrically implemented?
I'm referring to the fact that apr_initialize() creates
a pool (the 'global' pool) and apr_pool_alloc_term() destroys
this pool.

Any reason why apr_pool_alloc_init() [me would like apr_pool_initialize()
better, but then again it is still early in the morning for me ;)]
shouldn't create the 'global' pool?  apr_initialize() would
then have to call apr_pool_alloc_init() first, then create a
pool (which would become a subpool of the global pool), and use that
to pass to apr_get_oslevel() and apr_signal_init().

apr_terminate() could just do what it does now, only not pass a
pool to apr_pool_alloc_term() [/me mumbles something about apr_pool_terminate()].

Since there is no apparent API change to the outside world (noone
was supposed to call apr_pool_alloc_init()/apr_pool_alloc_term() directly!),
I would like to change apr_initialize()/apr_terminate().  Just scream
with objections if you don't want this.  I'll post a patch that works
against the pools 'rewrite' code.

Sander