apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r758610 - /apr/apr/trunk/memory/unix/apr_pools.c
Date Thu, 26 Mar 2009 12:41:30 GMT
Author: pquerna
Date: Thu Mar 26 12:41:22 2009
New Revision: 758610

URL: http://svn.apache.org/viewvc?rev=758610&view=rev
Log:
Remove calloc where possible.

Modified:
    apr/apr/trunk/memory/unix/apr_pools.c

Modified: apr/apr/trunk/memory/unix/apr_pools.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memory/unix/apr_pools.c?rev=758610&r1=758609&r2=758610&view=diff
==============================================================================
--- apr/apr/trunk/memory/unix/apr_pools.c (original)
+++ apr/apr/trunk/memory/unix/apr_pools.c Thu Mar 26 12:41:22 2009
@@ -640,7 +640,8 @@
 {
     if (pool->blocks->offset == BLOCK_LIST_ENTRIES_MAX) {
         block_list_t *ml = pool->blocks;
-        pool->blocks = calloc(1, sizeof(block_list_t));
+        pool->blocks = malloc(sizeof(block_list_t));
+        pool->blocks->offset = 0;
         pool->blocks->next = ml;
     }
     
@@ -801,7 +802,7 @@
     if (!abort_fn && parent)
         abort_fn = parent->abort_fn;
 
-    pool = calloc(1, sizeof(apr_pool_t));
+    pool = malloc(sizeof(apr_pool_t));
     pool->abort_fn = abort_fn;
     pool->child = NULL;
     pool->cleanups = NULL;
@@ -811,8 +812,9 @@
     pool->subprocesses = NULL;
     pool->user_data = NULL;
     pool->tag = NULL;
-    pool->blocks = calloc(1, sizeof(block_list_t));
-
+    pool->blocks = malloc(sizeof(block_list_t));
+    pool->blocks->offset = 0;
+    pool->blocks->next = NULL;
     (void)apr_thread_mutex_create(&pool->mutex,
                                   APR_THREAD_MUTEX_NESTED, pool);
     



Mime
View raw message