diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-04-30 21:17:57 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-04-30 21:17:57 +0000 |
commit | 1684ba7f65fe76d6f0f41b696a8229f51e6eacbf (patch) | |
tree | 93fc1a44de5c1d6f9461dd99eeba2973d6c88ee3 /threadproc/unix | |
parent | 70342641a3982c3c1bea7ec301a7167cfd82e7e9 (diff) | |
download | libapr-1684ba7f65fe76d6f0f41b696a8229f51e6eacbf.tar.gz |
Use ap_pcalloc instead of ap_palloc where it makes sense.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60005 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/unix')
-rw-r--r-- | threadproc/unix/proc.c | 17 | ||||
-rw-r--r-- | threadproc/unix/thread.c | 12 | ||||
-rw-r--r-- | threadproc/unix/threadpriv.c | 4 |
3 files changed, 11 insertions, 22 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 0d951f852..94f2b43a5 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -57,22 +57,13 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, - sizeof(ap_procattr_t)); + (*new) = (ap_procattr_t *)ap_pcalloc(cont, sizeof(ap_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->parent_in = NULL; - (*new)->child_in = NULL; - (*new)->parent_out = NULL; - (*new)->child_out = NULL; - (*new)->parent_err = NULL; - (*new)->child_err = NULL; - (*new)->currdir = NULL; (*new)->cmdtype = APR_PROGRAM; - (*new)->detached = 0; return APR_SUCCESS; } @@ -204,7 +195,7 @@ ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) { int pid; - (*proc) = ap_palloc(cont, sizeof(ap_proc_t)); + (*proc) = ap_pcalloc(cont, sizeof(ap_proc_t)); if ((pid = fork()) < 0) { return errno; @@ -228,7 +219,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, my_stupid_string *newargs; ap_proc_t *pgrp; - (*new) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); + (*new) = (ap_proc_t *)ap_pcalloc(cont, sizeof(ap_proc_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -369,7 +360,7 @@ ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc, return APR_ENOPOOL; } if ((*proc) == NULL) { - (*proc) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); + (*proc) = (ap_proc_t *)ap_pcalloc(cont, sizeof(ap_proc_t)); (*proc)->cntxt = cont; } (*proc)->pid = *theproc; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 300818e0f..d6190d8a7 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -62,10 +62,8 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) { ap_status_t stat; - (*new) = (ap_threadattr_t *)ap_palloc(cont, - sizeof(ap_threadattr_t)); - (*new)->attr = (pthread_attr_t *)ap_palloc(cont, - sizeof(pthread_attr_t)); + (*new) = (ap_threadattr_t *)ap_pcalloc(cont, sizeof(ap_threadattr_t)); + (*new)->attr = (pthread_attr_t *)ap_pcalloc(cont, sizeof(pthread_attr_t)); if ((*new) == NULL || (*new)->attr == NULL) { return APR_ENOMEM; @@ -108,13 +106,13 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, ap_status_t stat; pthread_attr_t *temp; - (*new) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*new) = (ap_thread_t *)ap_pcalloc(cont, sizeof(ap_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->td = (pthread_t *)ap_palloc(cont, sizeof(pthread_t)); + (*new)->td = (pthread_t *)ap_pcalloc(cont, sizeof(pthread_t)); if ((*new)->td == NULL) { return APR_ENOMEM; @@ -211,7 +209,7 @@ ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*thd) = (ap_thread_t *)ap_pcalloc(cont, sizeof(ap_thread_t)); (*thd)->cntxt = cont; } (*thd)->td = thethd; diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 9d82395a6..0c74f4784 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -62,7 +62,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), ap_pool_t *cont) { ap_status_t stat; - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (ap_threadkey_t *)ap_pcalloc(cont, sizeof(ap_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -142,7 +142,7 @@ ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (ap_threadkey_t *)ap_pcalloc(cont, sizeof(ap_threadkey_t)); (*key)->cntxt = cont; } (*key)->key = *thekey; |