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>]
#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.
-
+# 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
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
* 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;
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);
}
* 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 {
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);
+++ /dev/null
-# 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
+++ /dev/null
-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
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
* 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,