From: Sander Striker Date: Fri, 15 Mar 2002 00:50:31 +0000 (+0000) Subject: Update the mpms to call the new allocator/pools API X-Git-Tag: CHANGES~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50ba0ce732b5be04e32032f71ad1bf0e298cb185;p=apache Update the mpms to call the new allocator/pools API git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93943 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/beos/beos.c b/server/mpm/beos/beos.c index 25bfe5de25..a703d8e506 100644 --- a/server/mpm/beos/beos.c +++ b/server/mpm/beos/beos.c @@ -359,6 +359,7 @@ static int32 worker_thread(void * dummy) proc_info * ti = dummy; int child_slot = ti->slot; apr_pool_t *tpool = ti->tpool; + apr_allocator_t *allocator; apr_socket_t *csd = NULL; apr_pool_t *ptrans; /* Pool for per-transaction stuff */ apr_socket_t *sd = NULL; @@ -378,7 +379,10 @@ static int32 worker_thread(void * dummy) sigfillset(&sig_mask); sigprocmask(SIG_BLOCK, &sig_mask, NULL); - apr_pool_create_ex(&ptrans, tpool, NULL, APR_POOL_FNEW_ALLOCATOR); + apr_allocator_create(&allocator); + apr_pool_create_ex(&ptrans, tpool, NULL, allocator); + apr_allocator_set_owner(ptrans); + apr_pool_tag(ptrans, "transaction"); apr_lock_acquire(worker_thread_count_mutex); diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index c1b45d1b30..2b519d4c4b 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -352,6 +352,7 @@ void worker_main(void *arg) ap_listen_rec *lr; ap_listen_rec *last_lr = NULL; apr_pool_t *ptrans; + apr_allocator_t *allocator; conn_rec *current_conn; apr_status_t stat = APR_EINIT; int worker_num_arg = (int)arg; @@ -369,7 +370,10 @@ void worker_main(void *arg) tv.tv_sec = 1; tv.tv_usec = 0; - apr_pool_create_ex(&ptrans, NULL, NULL, APR_POOL_FNEW_ALLOCATOR); + apr_allocator_create(&allocator); + apr_pool_create_ex(&ptrans, NULL, NULL, allocator); + apr_allocator_set_owner(allocator, ptrans); + apr_pool_tag(ptrans, "transaction"); apr_thread_mutex_lock(worker_thread_count_mutex); diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index a1c07ddb6c..5fb2109ffd 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -518,6 +518,7 @@ int ap_graceful_stop_signalled(void) static void child_main(int child_num_arg) { apr_pool_t *ptrans; + apr_allocator_t *allocator; conn_rec *current_conn; apr_status_t status = APR_EINIT; int i; @@ -537,7 +538,9 @@ static void child_main(int child_num_arg) /* Get a sub context for global allocations in this child, so that * we can have cleanups occur when the child exits. */ - apr_pool_create_ex(&pchild, pconf, NULL, APR_POOL_FNEW_ALLOCATOR); + apr_allocator_create(&allocator); + apr_pool_create_ex(&pchild, pconf, NULL, allocator); + apr_allocator_set_owner(allocator, pchild); apr_pool_create(&ptrans, pchild); apr_pool_tag(ptrans, "transaction"); diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index cd4d8f8804..2e1223ca4f 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -679,7 +679,11 @@ static void *listener_thread(apr_thread_t *thd, void * dummy) if (!workers_may_exit) { /* create a new transaction pool for each accepted socket */ if (recycled_pool == NULL) { - apr_pool_create_ex(&ptrans, NULL, NULL, APR_POOL_FNEW_ALLOCATOR); + apr_allocator_t *allocator; + + apr_allocator_create(&allocator); + apr_pool_create_ex(&ptrans, NULL, NULL, allocator); + apr_allocator_set_owner(allocator, ptrans); } else { ptrans = recycled_pool;