]> granicus.if.org Git - apache/commitdiff
Transition mod_slotmem to ap_slotmem... just monkeying
authorJim Jagielski <jim@apache.org>
Thu, 1 Jan 2009 20:17:56 +0000 (20:17 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 1 Jan 2009 20:17:56 +0000 (20:17 +0000)
with the locations, etc. now... adding getter/setter
will be over the weekend and post-2.3.1 but I figured
at least do this beforehand...

I love trunk :)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@730597 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
include/ap_slotmem.h [moved from modules/mem/mod_slotmem.h with 91% similarity]
modules/mem/Makefile.in
modules/mem/config.m4
modules/mem/mod_plainmem.c [moved from modules/mem/providers/mod_plainmem.c with 89% similarity]
modules/mem/mod_sharedmem.c [moved from modules/mem/providers/mod_sharedmem.c with 95% similarity]
modules/mem/providers/Makefile.in [deleted file]
modules/mem/providers/config2.m4 [deleted file]
server/Makefile.in
server/slotmem.c [moved from modules/mem/mod_slotmem.c with 95% similarity]

diff --git a/CHANGES b/CHANGES
index 8509ae5e68b84d55040345711ec9f1d4661fdcda..a34acc2c1c73a5ff34f32adcc96e09dd237ca800 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,7 +2,7 @@
 Changes with Apache 2.3.1
 [ When backported to 2.2.x, remove entry from this file ]
 
- *) mod_slotmem: Add in new slot-based memory access API module, including
+ *) ap_slotmem: Add in new slot-based memory access API impl., including
     2 providers (mod_sharedmem and mod_plainmem) [Jim Jagielski,
     Jean-Frederic Clere, Brian Akins <brian.akins turner.com>]
 
similarity index 91%
rename from modules/mem/mod_slotmem.h
rename to include/ap_slotmem.h
index 3b1ac338c1dbca4baf8d28f8fb2510f1cb124ecb..2abdefaa05ec8855e060bacf60e810ba58c6b7ee 100644 (file)
 #include <unistd.h>         /* for getpid() */
 #endif
 
-#define SLOTMEM_STORAGE "slotmem"
+#define AP_SLOTMEM_STORAGE "slotmem"
 
 typedef struct ap_slotmem_t ap_slotmem_t;
 
-struct ap_slotmem_t {
-    char                 *name;       /* per segment name */
-    void                 *shm;        /* ptr to memory segment (apr_shm_t *) */
-    void                 *base;       /* data set start */
-    apr_size_t           size;        /* size of each memory slot */
-    int                  num;         /* number of mem slots */
-    apr_pool_t           *gpool;      /* per segment global pool */
-    apr_global_mutex_t   *smutex;     /* mutex */
-    void                 *context;    /* general purpose storage */
-    struct ap_slotmem_t  *next;       /* location of next allocated segment */
-};
-
-
 /**
  * callback function used for slotmem.
  * @param mem is the memory associated with a worker.
index e32210f185139c3056f9db99d43a2bae426aa69a..7c5c149d852ad309f0cd958ac3e84c3cb5b72dc9 100644 (file)
@@ -1,2 +1,3 @@
-
+# a modules Makefile has no explicit targets -- they will be defined by
+# whatever modules are enabled. just grab special.mk to deal with this.
 include $(top_srcdir)/build/special.mk
index aa1e99d5c5ef9607d0c86b83fa191d3f6d83093e..5f5014ce208042ade7443054a1f606dcf86fa17c 100644 (file)
@@ -3,19 +3,9 @@ dnl modules enabled in this directory by default
 dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
 
 APACHE_MODPATH_INIT(mem)
-if test "$enable_slotmem" = "shared"; then
-  slotmem_mods_enable=shared
-elif test "$enable_slotmem" = "yes"; then
-  slotmem_mods_enable=yes
-else
-  slotmem_mods_enable=no
-fi
 
-slotmem_objs="mod_slotmem.lo"
-
-APACHE_MODULE(slotmem, slot-based memory API using providers, $slotmem_objs, , most)
-
-# Ensure that other modules can pick up mod_slotmem.h
-APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
+sharedmem_objs="mod_sharedmem.lo"
+APACHE_MODULE(sharedmem, memslot provider that uses shared memory, $sharedmem_objs, , most)
+APACHE_MODULE(plainmem, memslot provider that uses plain memory, , , no)
 
 APACHE_MODPATH_FINISH
similarity index 89%
rename from modules/mem/providers/mod_plainmem.c
rename to modules/mem/mod_plainmem.c
index ae2380439442b0d72a3e4300cc6b0947b5c290de..968f7991fd18a1a6f883523a9622404fd4afb100 100644 (file)
  * This one uses plain memory.
  */
 
-#include  "mod_slotmem.h"
+#include  "ap_slotmem.h"
+
+struct ap_slotmem_t {
+    char                 *name;       /* per segment name */
+    void                 *base;       /* data set start */
+    apr_size_t           size;        /* size of each memory slot */
+    int                  num;         /* number of mem slots */
+    apr_pool_t           *gpool;      /* per segment global pool */
+    apr_global_mutex_t   *smutex;     /* mutex */
+    struct ap_slotmem_t  *next;       /* location of next allocated segment */
+};
+
 
 /* global pool and list of slotmem we are handling */
 static struct ap_slotmem_t *globallistmem = NULL;
@@ -156,7 +167,7 @@ static int pre_config(apr_pool_t *p, apr_pool_t *plog,
 static void ap_plainmem_register_hook(apr_pool_t *p)
 {
     /* XXX: static const char * const prePos[] = { "mod_slotmem.c", NULL }; */
-    ap_register_provider(p, SLOTMEM_STORAGE, "plain", "0", &storage);
+    ap_register_provider(p, AP_SLOTMEM_STORAGE, "plain", "0", &storage);
     ap_hook_pre_config(pre_config, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
similarity index 95%
rename from modules/mem/providers/mod_sharedmem.c
rename to modules/mem/mod_sharedmem.c
index 26015e2391dc57f107805aac922530efbb1a14bc..9f6c34857f28c1b21fc09f29022a89016c05316e 100644 (file)
  * This one uses shared memory.
  */
 
-#include  "mod_slotmem.h"
+#include  "ap_slotmem.h"
+
+struct ap_slotmem_t {
+    char                 *name;       /* per segment name */
+    void                 *shm;        /* ptr to memory segment (apr_shm_t *) */
+    void                 *base;       /* data set start */
+    apr_size_t           size;        /* size of each memory slot */
+    int                  num;         /* number of mem slots */
+    apr_pool_t           *gpool;      /* per segment global pool */
+    apr_global_mutex_t   *smutex;     /* mutex */
+    struct ap_slotmem_t  *next;       /* location of next allocated segment */
+};
+
 
 /* The description of the slots to reuse the slotmem */
 struct sharedslotdesc {
@@ -473,7 +485,7 @@ static void child_init(apr_pool_t *p, server_rec *s)
 static void ap_sharedmem_register_hook(apr_pool_t *p)
 {
     const ap_slotmem_storage_method *storage = sharedmem_getstorage();
-    ap_register_provider(p, SLOTMEM_STORAGE, "shared", "0", storage);
+    ap_register_provider(p, AP_SLOTMEM_STORAGE, "shared", "0", storage);
     ap_hook_post_config(post_config, NULL, NULL, APR_HOOK_LAST);
     ap_hook_pre_config(pre_config, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_child_init(child_init, NULL, NULL, APR_HOOK_MIDDLE);
diff --git a/modules/mem/providers/Makefile.in b/modules/mem/providers/Makefile.in
deleted file mode 100644 (file)
index 7c5c149..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# a modules Makefile has no explicit targets -- they will be defined by
-# whatever modules are enabled. just grab special.mk to deal with this.
-include $(top_srcdir)/build/special.mk
diff --git a/modules/mem/providers/config2.m4 b/modules/mem/providers/config2.m4
deleted file mode 100644 (file)
index bdfd3d8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-dnl modules enabled in this directory by default
-
-dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
-
-APACHE_MODPATH_INIT(mem/providers)
-
-sharedmem_objs="mod_sharedmem.lo"
-APACHE_MODULE(sharedmem, memslot provider that uses shared memory, $sharedmem_objs, , $slotmem_mods_enable)
-APACHE_MODULE(plainmem, memslot provider that uses plain memory, , , no)
-
-APACHE_MODPATH_FINISH
index 4a3b6099a75924fbf284f2cb292109cd4df13497..2da92b1c6bc357a53435b7c4e61860726b8ed08f 100644 (file)
@@ -14,7 +14,7 @@ LTLIBRARY_SOURCES = \
        mpm_common.c util_charset.c util_cookies.c util_debug.c util_xml.c \
        util_expr.c util_filter.c util_pcre.c exports.c \
        scoreboard.c error_bucket.c protocol.c core.c request.c provider.c \
-       eoc_bucket.c eor_bucket.c core_filters.c
+       eoc_bucket.c eor_bucket.c core_filters.c slotmem.c
 
 TARGETS = delete-exports $(LTLIBRARY_NAME) $(CORE_IMPLIB_FILE) export_vars.h httpd.exp
 
similarity index 95%
rename from modules/mem/mod_slotmem.c
rename to server/slotmem.c
index 7810e7e884e69fd58f8a3f5a65d7d4be99a4e81c..9af25a7699de6bc2717037962d90f7d00b8c028a 100644 (file)
  * front-end to the actual memory providers.
  */
 
-#include  "mod_slotmem.h"
+#include  "ap_slotmem.h"
 
 AP_DECLARE(apr_array_header_t *) ap_slotmem_methods(apr_pool_t *pool)
 {
-    return (ap_list_provider_names(pool, SLOTMEM_STORAGE, "0"));
+    return (ap_list_provider_names(pool, AP_SLOTMEM_STORAGE, "0"));
 }
 
 AP_DECLARE(ap_slotmem_storage_method *) ap_slotmem_method(const char *provider)
 {
-    return (ap_lookup_provider(SLOTMEM_STORAGE, provider, "0"));
+    return (ap_lookup_provider(AP_SLOTMEM_STORAGE, provider, "0"));
 }
 
 AP_DECLARE(apr_status_t) ap_slotmem_do(ap_slotmem_storage_method *sm,