httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1411279 - in /httpd/httpd/trunk/server/mpm/eventopt: skiplist.c skiplist.h
Date Mon, 19 Nov 2012 16:28:14 GMT
Author: jim
Date: Mon Nov 19 16:28:13 2012
New Revision: 1411279

URL: http://svn.apache.org/viewvc?rev=1411279&view=rev
Log:
skiplist_destroy() is new-ish

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

Modified: httpd/httpd/trunk/server/mpm/eventopt/skiplist.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/eventopt/skiplist.c?rev=1411279&r1=1411278&r2=1411279&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/eventopt/skiplist.c (original)
+++ httpd/httpd/trunk/server/mpm/eventopt/skiplist.c Mon Nov 19 16:28:13 2012
@@ -663,6 +663,19 @@ void *skiplist_peek(Skiplist *a)
     return data;
 }
 
+static void skiplisti_destroy(void *vsl)
+{
+    skiplist_destroy((Skiplist *) vsl, NULL);
+    skiplist_free((Skiplist *) vsl, vsl);
+}
+
+void skiplist_destroy(Skiplist *sl, FreeFunc myfree)
+{
+    while (skiplist_pop(sl->index, skiplisti_destroy) != NULL)
+        ;
+    skiplist_remove_all(sl, myfree);
+}
+
 Skiplist *skiplist_merge(Skiplist *sl1, Skiplist *sl2)
 {
     /* Check integrity! */

Modified: httpd/httpd/trunk/server/mpm/eventopt/skiplist.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/eventopt/skiplist.h?rev=1411279&r1=1411278&r2=1411279&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/eventopt/skiplist.h (original)
+++ httpd/httpd/trunk/server/mpm/eventopt/skiplist.h Mon Nov 19 16:28:13 2012
@@ -98,6 +98,8 @@ int skiplisti_remove(Skiplist *sl, skipl
 
 void skiplist_remove_all(Skiplist *sl, FreeFunc myfree);
 
+void skiplist_destroy(Skiplist *sl, FreeFunc myfree);
+
 #if 0
 int skiplisti_find_compare(Skiplist *sl,
                            void *data,



Mime
View raw message