]> granicus.if.org Git - apache/commitdiff
To save memory, make module_levels a vector of chars instead of ints.
authorStefan Fritsch <sf@apache.org>
Wed, 30 Jun 2010 18:09:06 +0000 (18:09 +0000)
committerStefan Fritsch <sf@apache.org>
Wed, 30 Jun 2010 18:09:06 +0000 (18:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959392 13f79535-47bb-0310-9956-ffa450edef68

include/ap_mmn.h
include/httpd.h
server/config.c

index 9e01feab1f139ac85147893a7cce9d0d3ba0805d..eb897b5544d3c8956f579078a5683788bf9f6509 100644 (file)
  * 20100609.1 (2.3.7-dev)  Introduce ap_log_cserror()
  * 20100609.2 (2.3.7-dev)  Add deferred write pool to core_output_filter_ctx
  * 20100625.0 (2.3.7-dev)  Add 'userctx' to socache iterator callback prototype
+ * 20100630.0 (2.3.7-dev)  make module_levels vector of char instead of int
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20100625
+#define MODULE_MAGIC_NUMBER_MAJOR 20100630
 #endif
 #define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
 
index 32ee4986eded5faf52597c668f6196642a23bc07..8dc7af8ef45cc95070a7186c6a495fe8875c7645 100644 (file)
@@ -1172,7 +1172,7 @@ struct server_addr_rec {
 
 struct ap_logconf {
     /** The per-module log levels */
-    int *module_levels;
+    signed char *module_levels;
 
     /** The log level for this server */
     int level;
index 7c0430d5bc464e25ee050a46c927da62c4f314b2..9e609a57a50dae5ee5544aa4590dc6f9b3ea8412 100644 (file)
@@ -1374,18 +1374,15 @@ AP_DECLARE_NONSTD(const char *) ap_set_deprecated(cmd_parms *cmd,
 
 AP_DECLARE(void) ap_reset_module_loglevels(struct ap_logconf *l, int val)
 {
-    if (l->module_levels) {
-        int i;
-        for (i = 0; i < conf_vector_length; i++)
-            l->module_levels[i] = val;
-    }
+    if (l->module_levels)
+        memset(l->module_levels, val, conf_vector_length);
 }
 
 AP_DECLARE(void) ap_set_module_loglevel(apr_pool_t *pool, struct ap_logconf *l,
                                         int index, int level)
 {
     if (!l->module_levels) {
-        l->module_levels = apr_palloc(pool, sizeof(int) * conf_vector_length);
+        l->module_levels = apr_palloc(pool, conf_vector_length);
         if (l->level == APLOG_UNSET) {
                 ap_reset_module_loglevels(l, APLOG_UNSET);
         }
@@ -2033,7 +2030,7 @@ AP_DECLARE(struct ap_logconf *) ap_new_log_config(apr_pool_t *p,
         l->level = old->level;
         if (old->module_levels) {
             l->module_levels =
-                apr_pmemdup(p, old->module_levels, sizeof(int) * conf_vector_length);
+                apr_pmemdup(p, old->module_levels, conf_vector_length);
         }
     }
     else {