httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1411424 - /httpd/httpd/trunk/server/mpm/eventopt/skiplist.c
Date Mon, 19 Nov 2012 21:24:05 GMT
Author: jim
Date: Mon Nov 19 21:24:04 2012
New Revision: 1411424

URL: http://svn.apache.org/viewvc?rev=1411424&view=rev
Log:
Force even malloc'ed mem to be 0ed. And pull out wasted cycles that
did the nulling.

Modified:
    httpd/httpd/trunk/server/mpm/eventopt/skiplist.c

Modified: httpd/httpd/trunk/server/mpm/eventopt/skiplist.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/eventopt/skiplist.c?rev=1411424&r1=1411423&r2=1411424&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/eventopt/skiplist.c (original)
+++ httpd/httpd/trunk/server/mpm/eventopt/skiplist.c Mon Nov 19 21:24:04 2012
@@ -47,7 +47,7 @@ void *skiplist_alloc(Skiplist *sl, size_
         return apr_palloc(sl->pool, size);
     }
     else {
-        return ap_malloc(size);
+        return ap_calloc(1, size);
     }
 }
 
@@ -65,8 +65,9 @@ static apr_status_t skiplisti_init(Skipl
         sl = apr_palloc(p, sizeof(Skiplist));
     }
     else {
-        sl = ap_malloc(sizeof(Skiplist));
+        sl = ap_calloc(1, sizeof(Skiplist));
     }
+#if 0
     sl->compare = (SkiplistComparator) NULL;
     sl->comparek = (SkiplistComparator) NULL;
     sl->height = 0;
@@ -75,6 +76,7 @@ static apr_status_t skiplisti_init(Skipl
     sl->top = NULL;
     sl->bottom = NULL;
     sl->index = NULL;
+#endif
     sl->pool = p;
     *s = sl;
     return APR_SUCCESS;
@@ -267,6 +269,7 @@ skiplistnode *skiplist_insert_compare(Sk
         sl->topend = sl->bottomend = sl->top = sl->bottom =
             (skiplistnode *)skiplist_alloc(sl, sizeof(skiplistnode));
         AP_DEBUG_ASSERT(sl->top);
+#if 0
         sl->top->next = (skiplistnode *)NULL;
         sl->top->data = (skiplistnode *)NULL;
         sl->top->prev = (skiplistnode *)NULL;
@@ -274,6 +277,7 @@ skiplistnode *skiplist_insert_compare(Sk
         sl->top->down = (skiplistnode *)NULL;
         sl->top->nextindex = (skiplistnode *)NULL;
         sl->top->previndex = (skiplistnode *)NULL;
+#endif
         sl->top->sl = sl;
     }
     if (sl->preheight) {
@@ -297,9 +301,11 @@ skiplistnode *skiplist_insert_compare(Sk
         AP_DEBUG_ASSERT(sl->top->up);
         sl->top->up->down = sl->top;
         sl->top = sl->topend = sl->top->up;
+#if 0
         sl->top->prev = sl->top->next = sl->top->nextindex =
             sl->top->previndex = sl->top->up = NULL;
         sl->top->data = NULL;
+#endif
         sl->top->sl = sl;
     }
     ch = sl->height;
@@ -699,4 +705,3 @@ Skiplist *skiplist_merge(Skiplist *sl1, 
     skiplist_remove_all(sl2, NULL);
     return sl1;
 }
-



Mime
View raw message