axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r502482 - in /webservices/axis2/trunk/c: modules/core/transport/http/server/apache2/mod_axis2.c util/include/axis2_allocator.h util/src/allocator.c
Date Fri, 02 Feb 2007 04:37:25 GMT
Author: damitha
Date: Thu Feb  1 20:37:24 2007
New Revision: 502482

URL: http://svn.apache.org/viewvc?view=rev&rev=502482
Log:
in addition to local_pool and global_pool introduced a current_pool.
At any moment current pool could be global or local depending on the
pool switch. 

Modified:
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c
    webservices/axis2/trunk/c/util/include/axis2_allocator.h
    webservices/axis2/trunk/c/util/src/allocator.c

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c?view=diff&rev=502482&r1=502481&r2=502482
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c Thu Feb
 1 20:37:24 2007
@@ -231,7 +231,7 @@
     }
     ap_should_client_block(req);
 
-    axis2_env->allocator->local_pool = (void*) req->pool;
+    axis2_env->allocator->current_pool = (void*) req->pool;
     rv = AXIS2_APACHE2_WORKER_PROCESS_REQUEST(axis2_worker, axis2_env, req);
 
     if (AXIS2_CRITICAL_FAILURE == rv)
@@ -245,7 +245,8 @@
 axis2_module_malloc(
     axis2_allocator_t *allocator, size_t size)
 {
-    return apr_palloc((apr_pool_t*) (allocator->local_pool), size);
+    void *ret_obj = NULL;
+    return apr_palloc((apr_pool_t*) (allocator->current_pool), size);
 }
 
 void * AXIS2_CALL
@@ -302,6 +303,7 @@
     allocator->realloc = axis2_module_realloc;
     allocator->free_fn = axis2_module_free;
     allocator->local_pool = (void*) pool;
+    allocator->current_pool = (void*) pool;
     allocator->global_pool = (void*) pool;
 
     if (NULL == allocator)

Modified: webservices/axis2/trunk/c/util/include/axis2_allocator.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/axis2_allocator.h?view=diff&rev=502482&r1=502481&r2=502482
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_allocator.h (original)
+++ webservices/axis2/trunk/c/util/include/axis2_allocator.h Thu Feb  1 20:37:24 2007
@@ -77,6 +77,8 @@
          void *local_pool;
         /** global memory pool */
          void *global_pool;
+         /** memory pool in use currently */
+         void *current_pool;
     } axis2_allocator_t;
 
   /**

Modified: webservices/axis2/trunk/c/util/src/allocator.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/allocator.c?view=diff&rev=502482&r1=502481&r2=502482
==============================================================================
--- webservices/axis2/trunk/c/util/src/allocator.c (original)
+++ webservices/axis2/trunk/c/util/src/allocator.c Thu Feb  1 20:37:24 2007
@@ -81,23 +81,18 @@
 AXIS2_EXTERN void AXIS2_CALL 
 axis2_allocator_switch_to_global_pool(axis2_allocator_t *allocator)
 {   
-    void *temp = NULL;
     if (!allocator)
         return;
-    temp = allocator->local_pool;
-    allocator->local_pool = allocator->global_pool;
-    allocator->global_pool = temp;
+    allocator->current_pool = allocator->global_pool;
     return;
 }
 
 AXIS2_EXTERN void AXIS2_CALL 
 axis2_allocator_switch_to_local_pool(axis2_allocator_t *allocator)
 {
-    void *temp = NULL;
     if (!allocator)
         return;
-    temp = allocator->global_pool;
-    allocator->global_pool = allocator->local_pool;
-    allocator->local_pool = temp;
+    allocator->current_pool = allocator->local_pool;
     return;
 }
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message