httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Williams <>
Subject ap_pool support for shared memory?
Date Tue, 27 Jun 2000 00:46:51 GMT
I may have a need to use shared memory, but would also like to use the
pool routines found in apr_pools.c, since they simplify memory
management.  The current obstacle being that these routines only call
malloc/free.  Has any one else had a similiar need, or see reasons
they could not be enhanced?   I was thinking along the lines of
something similiar to:

A) In addition to the existing ap_create_pool(), add a companion
ap_set_pool_allocator( void *opaque_allocator_object,
                       void (*pool_malloc)(void *opaque, size_t size), 
                       void (*pool_free)(void *opaque, void *ptr) );
Or combine with ap_create_pool() to create a new
ap_create_pool_with_allocator() type call. These 3 parameters would be
stored in ap_pool_t for later retrieval

B) Update malloc_block() and other apr_pools.c routines to call the
pool_malloc()/pool_free() when they have been set for that pool. 
Subpools would inherit these allocate/deallocate routines.

Also I was curious: 

1. Is ap_create_pool() located in lib/apr/misc/*/start.c in order to
be platform dependent?  The code looks the nearly same between
platforms, with the beos version slightly different from the other
two, though it is not clear why.

2. ap_shm_init() has a ap_pool_t parameter that is not used.  As if
someone had thought of tying the shared mem to a pool (instead of the
other way around)?


View raw message