Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 98815 invoked by uid 500); 18 Mar 2002 15:01:44 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 98804 invoked from network); 18 Mar 2002 15:01:44 -0000 Date: 18 Mar 2002 15:01:43 -0000 Message-ID: <20020318150143.13420.qmail@icarus.apache.org> From: striker@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/memory/unix apr_pools.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N striker 02/03/18 07:01:43 Modified: include apr_pools.h memory/unix apr_pools.c Log: Style Police patrols in the backyard... Revision Changes Path 1.81 +28 -28 apr/include/apr_pools.h Index: apr_pools.h =================================================================== RCS file: /home/cvs/apr/include/apr_pools.h,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- apr_pools.h 15 Mar 2002 00:48:24 -0000 1.80 +++ apr_pools.h 18 Mar 2002 15:01:42 -0000 1.81 @@ -73,13 +73,13 @@ * Instead, we maintain pools, and allocate items (both memory and I/O * handlers) from the pools --- currently there are two, one for per * transaction info, and one for config info. When a transaction is over, - * we can delete everything in the per-transaction apr_pool_t without fear, + * we can delete everything in the per-transaction apr_pool_t without fear, * and without thinking too hard about it either. */ -/** +/** * @defgroup APR_Pool Pool Allocation Functions * @ingroup APR - * @{ + * @{ */ #include "apr.h" #include "apr_errno.h" @@ -153,7 +153,7 @@ /** * Setup all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this - * automatically from apr_initialize. + * automatically from apr_initialize. * @internal */ APR_DECLARE(apr_status_t) apr_pool_initialize(void); @@ -161,10 +161,10 @@ /** * Tear down all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this - * automatically from apr_terminate. + * automatically from apr_terminate. * @internal */ -APR_DECLARE(void) apr_pool_terminate(void); +APR_DECLARE(void) apr_pool_terminate(void); /* @@ -176,7 +176,7 @@ * @param newpool The pool we have just created. * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all - * of its parent pool's attributes, except the apr_pool_t will + * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. * @param apr_abort A function to use if the pool cannot allocate more memory. * @param flags Flags indicating how the pool should be created: @@ -224,7 +224,7 @@ * @param newpool The pool we have just created. * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all - * of its parent pool's attributes, except the apr_pool_t will + * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. */ #if defined(DOXYGEN) @@ -263,8 +263,8 @@ * Clear all memory in the pool and run all the cleanups. This also destroys all * subpools. * @param p The pool to clear - * @remark This does not actually free the memory, it just allows the pool - * to re-use this memory for the next allocation. + * @remark This does not actually free the memory, it just allows the pool + * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); @@ -326,19 +326,19 @@ /** * Allocate a block of memory from a pool - * @param p The pool to allocate from - * @param size The amount of memory to allocate + * @param p The pool to allocate from + * @param size The amount of memory to allocate * @return The allocated memory */ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); /** * Debug version of apr_palloc - * @param p See: apr_palloc - * @param size See: apr_palloc + * @param p See: apr_palloc + * @param size See: apr_palloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. - * @return See: apr_palloc + * @return See: apr_palloc */ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line); @@ -347,22 +347,22 @@ #define apr_palloc(p, size) \ apr_palloc_debug(p, size, APR_POOL__FILE_LINE__) #endif - + /** * Allocate a block of memory from a pool and set all of the memory to 0 - * @param p The pool to allocate from - * @param size The amount of memory to allocate + * @param p The pool to allocate from + * @param size The amount of memory to allocate * @return The allocated memory */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); /** * Debug version of apr_pcalloc - * @param p See: apr_pcalloc - * @param size See: apr_pcalloc + * @param p See: apr_pcalloc + * @param size See: apr_pcalloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. - * @return See: apr_pcalloc + * @return See: apr_pcalloc */ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line); @@ -404,7 +404,7 @@ /** * Determine if pool a is an ancestor of pool b - * @param a The pool to search + * @param a The pool to search * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. @@ -480,9 +480,9 @@ /** * Register a function to be called when a pool is cleared or destroyed - * @param p The pool register the cleanup with + * @param p The pool register the cleanup with * @param data The data to pass to the cleanup function. - * @param plain_cleanup The function to call when the pool is cleared + * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is created - * this function is called in the child, obviously! @@ -495,7 +495,7 @@ /** * Remove a previously registered cleanup function - * @param p The pool remove the cleanup from + * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup * @remarks For some strange reason only the plain_cleanup is handled by this @@ -520,7 +520,7 @@ /** * Run the specified cleanup function immediately and unregister it. Use * @a data instead of the data that was registered with the cleanup. - * @param p The pool remove the cleanup from + * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ @@ -530,7 +530,7 @@ apr_status_t (*cleanup)(void *)); /** - * An empty cleanup function + * An empty cleanup function * @param data The data to cleanup */ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); @@ -539,7 +539,7 @@ * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ /** - * Run all of the child_cleanups, so that any unnecessary files are + * Run all of the child_cleanups, so that any unnecessary files are * closed because we are about to exec a new program */ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); 1.160 +22 -18 apr/memory/unix/apr_pools.c Index: apr_pools.c =================================================================== RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v retrieving revision 1.159 retrieving revision 1.160 diff -u -r1.159 -r1.160 --- apr_pools.c 15 Mar 2002 00:48:24 -0000 1.159 +++ apr_pools.c 18 Mar 2002 15:01:42 -0000 1.160 @@ -309,7 +309,8 @@ } APR_INLINE -APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) +APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, + apr_memnode_t *node) { apr_memnode_t *next; apr_uint32_t index, max_index; @@ -332,8 +333,9 @@ /* Add the node to the appropiate 'size' bucket. Adjust * the max_index when appropiate. */ - if ((node->next = allocator->free[index]) == NULL && index > max_index) { - max_index = index; + if ((node->next = allocator->free[index]) == NULL + && index > max_index) { + max_index = index; } allocator->free[index] = node; } @@ -344,8 +346,7 @@ node->next = allocator->free[0]; allocator->free[0] = node; } - } - while ((node = next) != NULL); + } while ((node = next) != NULL); allocator->max_index = max_index; @@ -708,7 +709,8 @@ if (allocator == NULL) allocator = parent->allocator; - if ((node = apr_allocator_alloc(allocator, MIN_ALLOC - SIZEOF_MEMNODE_T)) == NULL) { + if ((node = apr_allocator_alloc(allocator, + MIN_ALLOC - SIZEOF_MEMNODE_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1432,8 +1434,8 @@ while (node) { for (index = 0; index < node->index; index++) { - if (node->beginp[index] <= *pmem && - node->endp[index] > *pmem) { + if (node->beginp[index] <= *pmem + && node->endp[index] > *pmem) { *pmem = pool; return 1; } @@ -1584,9 +1586,10 @@ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, + const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool) { #if APR_POOL_DEBUG apr_pool_check_integrity(pool); @@ -1603,7 +1606,8 @@ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, + apr_pool_t *pool) { #if APR_POOL_DEBUG apr_pool_check_integrity(pool); @@ -1650,7 +1654,7 @@ } APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup_fn)(void *)) + apr_status_t (*cleanup_fn)(void *)) { cleanup_t *c, **lastp; @@ -1675,8 +1679,8 @@ } APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup_fn) (void *), - apr_status_t (*child_cleanup_fn) (void *)) + apr_status_t (*plain_cleanup_fn)(void *), + apr_status_t (*child_cleanup_fn)(void *)) { cleanup_t *c; @@ -1699,7 +1703,7 @@ } APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, - apr_status_t (*cleanup_fn) (void *)) + apr_status_t (*cleanup_fn)(void *)) { apr_pool_cleanup_kill(p, data, cleanup_fn); return (*cleanup_fn)(data); @@ -1798,8 +1802,8 @@ #endif /* !defined(NEED_WAITPID) */ for (pc = procs; pc; pc = pc->next) { - if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT) || - (pc->kill_how == APR_KILL_ONLY_ONCE)) { + if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT) + || (pc->kill_how == APR_KILL_ONLY_ONCE)) { /* * Subprocess may be dead already. Only need the timeout if not. * Note: apr_proc_kill on Windows is TerminateProcess(), which is