[cvslog] (2005-03-02 17:22:54 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Wed Mar 2 11:22:55 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2005-03-02 17:22:54 UTC
Commited by: Bryan Drewery <lordares at shatow.net>

Modified files:
     lib/eggdrop/hash_table.c

Log message:

* Added some comments on the hash table resizing to clear up some confusion I personally had
  and some others may have had at some point.

---------------------- diff included ----------------------
Index: eggdrop1.9/lib/eggdrop/hash_table.c
diff -u eggdrop1.9/lib/eggdrop/hash_table.c:1.15 eggdrop1.9/lib/eggdrop/hash_table.c:1.16
--- eggdrop1.9/lib/eggdrop/hash_table.c:1.15	Sun Oct 17 00:14:06 2004
+++ eggdrop1.9/lib/eggdrop/hash_table.c	Wed Mar  2 11:22:44 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: hash_table.c,v 1.15 2004/10/17 05:14:06 stdarg Exp $";
+static const char rcsid[] = "$Id: hash_table.c,v 1.16 2005/03/02 17:22:44 lordares Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -78,6 +78,11 @@
 {
 	if (!ht) return(-1);
 
+	/* This 100 allows (ht->max_rows) linked lists each with an average of 100 elements in the list
+         * before actually resizing.
+         * This is done to avoid a very slow and cpu intensive resize which requires recalculating all hashes.
+         * Having (ht->max_rows) linked lists is still more effecient than one large linked list.
+         */
 	if (ht->cells_in_use / ht->max_rows > 100) {
 		hash_table_resize(ht, ht->max_rows * 3);
 	}
----------------------- End of diff -----------------------



More information about the Changes mailing list