httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r771286 - in /httpd/httpd/trunk: include/ap_slotmem.h modules/mem/mod_sharedmem.c server/slotmem.c
Date Mon, 04 May 2009 12:22:37 GMT
Author: jfclere
Date: Mon May  4 12:22:36 2009
New Revision: 771286

URL: http://svn.apache.org/viewvc?rev=771286&view=rev
Log:
Add a parameter for slotmem_create for the persistancy of the slotmem area.

Modified:
    httpd/httpd/trunk/include/ap_slotmem.h
    httpd/httpd/trunk/modules/mem/mod_sharedmem.c
    httpd/httpd/trunk/server/slotmem.c

Modified: httpd/httpd/trunk/include/ap_slotmem.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_slotmem.h?rev=771286&r1=771285&r2=771286&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_slotmem.h (original)
+++ httpd/httpd/trunk/include/ap_slotmem.h Mon May  4 12:22:36 2009
@@ -50,6 +50,8 @@
 
 #define AP_SLOTMEM_STORAGE "slotmem"
 
+#define CREPER_SLOTMEM 2 /* create a persistent slotmem */
+
 typedef struct ap_slotmem_t ap_slotmem_t;
 
 /**
@@ -81,10 +83,11 @@
      * @param name is a key used for debugging and in mod_status output or allow another
process to share this space.
      * @param item_size size of each item
      * @param item_num number of item to create.
+     * @param type type of slotmem.
      * @param pool is pool used
      * @return APR_SUCCESS if all went well
      */
-    apr_status_t (* slotmem_create)(ap_slotmem_t **new, const char *name, apr_size_t item_size,
unsigned int item_num, apr_pool_t *pool);
+    apr_status_t (* slotmem_create)(ap_slotmem_t **new, const char *name, apr_size_t item_size,
unsigned int item_num, int type, apr_pool_t *pool);
     /**
      * attach to an existing slotmem.
      * This would attach to  shared memory, basically.
@@ -163,10 +166,11 @@
  * @param name is a key used for debugging and in mod_status output or allow another process
to share this space.
  * @param item_size size of each item
  * @param item_num number of item to create.
+ * @param type (persistent/allocatable/etc)
  * @param pool is pool used
  * @return APR_SUCCESS if all went well
  */
-AP_DECLARE(apr_status_t) ap_slotmem_create(ap_slotmem_storage_method *sm, ap_slotmem_t **new,
const char *name, apr_size_t item_size, unsigned int item_num, apr_pool_t *pool);
+AP_DECLARE(apr_status_t) ap_slotmem_create(ap_slotmem_storage_method *sm, ap_slotmem_t **new,
const char *name, apr_size_t item_size, unsigned int item_num, int type, apr_pool_t *pool);
 
 /**
  * attach to an existing slotmem.

Modified: httpd/httpd/trunk/modules/mem/mod_sharedmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mem/mod_sharedmem.c?rev=771286&r1=771285&r2=771286&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mem/mod_sharedmem.c (original)
+++ httpd/httpd/trunk/modules/mem/mod_sharedmem.c Mon May  4 12:22:36 2009
@@ -207,7 +207,7 @@
     return APR_SUCCESS;
 }
 
-static apr_status_t slotmem_create(ap_slotmem_t **new, const char *name, apr_size_t item_size,
unsigned int item_num, apr_pool_t *pool)
+static apr_status_t slotmem_create(ap_slotmem_t **new, const char *name, apr_size_t item_size,
unsigned int item_num, int type, apr_pool_t *pool)
 {
 /*    void *slotmem = NULL; */
     void *ptr;
@@ -292,7 +292,8 @@
         memcpy(ptr, &desc, sizeof(desc));
         ptr = ptr + sizeof(desc);
         memset(ptr, 0, item_size * item_num);
-        restore_slotmem(ptr, fname, item_size, item_num, pool);
+        if (type & CREPER_SLOTMEM)
+            restore_slotmem(ptr, fname, item_size, item_num, pool);
     }
 
     /* For the chained slotmem stuff */

Modified: httpd/httpd/trunk/server/slotmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/slotmem.c?rev=771286&r1=771285&r2=771286&view=diff
==============================================================================
--- httpd/httpd/trunk/server/slotmem.c (original)
+++ httpd/httpd/trunk/server/slotmem.c Mon May  4 12:22:36 2009
@@ -42,9 +42,10 @@
 AP_DECLARE(apr_status_t) ap_slotmem_create(ap_slotmem_storage_method *sm,
                                            ap_slotmem_t **new, const char *name,
                                            apr_size_t item_size, unsigned int item_num,
+                                           int type,
                                            apr_pool_t *pool)
 {
-    return (sm->slotmem_create(new, name, item_size, item_num, pool));
+    return (sm->slotmem_create(new, name, item_size, item_num, type, pool));
 }
 
 AP_DECLARE(apr_status_t) ap_slotmem_attach(ap_slotmem_storage_method *sm,



Mime
View raw message