On Dec 23, 2008, at 3:56 PM, Ruediger Pluem wrote:
Added: httpd/httpd/trunk/modules/mem/config5.m4
URL: 
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mem/config5.m4?rev=729059&view=auto
=
=
=
=
=
=
=
=
=
=====================================================================
--- httpd/httpd/trunk/modules/mem/config5.m4 (added)
+++ httpd/httpd/trunk/modules/mem/config5.m4 Tue Dec 23 10:39:56 2008
@@ -0,0 +1,14 @@
+dnl modules enabled in this directory by default
+
+dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
+
+APACHE_MODPATH_INIT(mem)
+
+sharedmem_objs="mod_sharedmem.lo sharedmem_util.lo"
+APACHE_MODULE(sharedmem, memslot provider that uses shared memory, $sharedmem_objs, , most) +APACHE_MODULE(plainmem, memslot provider that uses plain memory, , , no)
+
+# Ensure that other modules can pick up slotmem.h
+APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])

Hm. I think this should be in includes if it is intended to be used by other stock modules
and at least it needs to be copied to includes during installation.


?? If other modules use this, then the module needs to be enabled
at which point -I is setup to find the required header files.

+static const char *store_filename(apr_pool_t *pool, const char *slotmemname)
+{
+    const char *storename;
+    const char *fname;
+    if (strcmp(slotmemname, "anonymous") == 0)
+        fname = ap_server_root_relative(pool, "logs/anonymous");

Hm. Hardcoded relative location? This looks ugly.

Yep


+
+static apr_status_t ap_slotmem_do(ap_slotmem_t *mem, ap_slotmem_callback_fn_t *func, void *data, apr_pool_t *pool)
+{
+    int i;
+    void *ptr;
+
+    if (!mem) {
+        return APR_ENOSHMAVAIL;
+    }
+
+    ptr = mem->base;
+    for (i = 0; i < mem->num; i++) {
+        ptr = ptr + mem->size;
+        func((void *)ptr, data, pool);
+    }
+    return 0;

Why not APR_SUCCESS?


Fixed 729309


If item_size and item_num do not match with what is saved the caller gets not notified that something bad
happened.


Hmmm... yeah...

+    }
+
+    /* For the chained slotmem stuff */
+    res->name = apr_pstrdup(globalpool, fname);
+    res->base = ptr;
+    res->size = item_size;
+    res->num = item_num;
+    res->globalpool = globalpool;
+    res->next = NULL;
+    if (globallistmem==NULL) {
+        globallistmem = res;
+    }
+    else {
+        next->next = res;
+    }

Why no stack approach, but a queue approach for the list?


Let me profile both....


Reply via email to