[movitz-cvs] CVS update: movitz/storage-types.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Thu Jul 21 18:48:34 UTC 2005


Update of /project/movitz/cvsroot/movitz
In directory common-lisp.net:/tmp/cvs-serv4535

Modified Files:
	storage-types.lisp 
Log Message:
Add *hash-table-size-factor* variable. The size of the dumped
hash-tables is now approximately computed as
   (* (hash-table-count hash-table)
      *hash-table-size-factor*)

Date: Thu Jul 21 20:48:33 2005
Author: ffjeld

Index: movitz/storage-types.lisp
diff -u movitz/storage-types.lisp:1.54 movitz/storage-types.lisp:1.55
--- movitz/storage-types.lisp:1.54	Tue Jun 14 01:00:17 2005
+++ movitz/storage-types.lisp	Thu Jul 21 20:48:33 2005
@@ -9,7 +9,7 @@
 ;;;; Created at:    Sun Oct 22 00:22:43 2000
 ;;;; Distribution:  See the accompanying file COPYING.
 ;;;;                
-;;;; $Id: storage-types.lisp,v 1.54 2005/06/13 23:00:17 ffjeld Exp $
+;;;; $Id: storage-types.lisp,v 1.55 2005/07/21 18:48:33 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -1019,10 +1019,13 @@
     (t (warn "Don't know how to take SXHASH of ~S." object)
        0)))
 
+(defvar *hash-table-size-factor* 5/4)
+
 (defun make-movitz-hash-table (lisp-hash)
   (let* ((undef (movitz-read +undefined-hash-key+))
 	 (hash-count (hash-table-count lisp-hash))
-	 (hash-size (logand -2 (truncate (* 2 4/3 (+ 7 hash-count)))))
+	 (hash-size (logand -2 (truncate (* 2 (+ 7 hash-count)
+					    *hash-table-size-factor*))))
 	 (bucket-data (make-array hash-size :initial-element undef)))
     (multiple-value-bind (hash-test hash-sxhash)
 	(ecase (hash-table-test lisp-hash)
@@ -1058,7 +1061,8 @@
   (let* ((undef (movitz-read +undefined-hash-key+))
 	 (old-bucket (second (movitz-struct-slot-values movitz-hash)))
 	 (hash-count (hash-table-count lisp-hash))
-	 (hash-size (logand -2 (truncate (* 2 4/3 (+ 7 hash-count)))))
+	 (hash-size (logand -2 (truncate (* 2 (+ 7 hash-count)
+					    *hash-table-size-factor*))))
 	 (bucket-data (or (and old-bucket
 			       (= (length (movitz-vector-symbolic-data old-bucket))
 				  hash-size)




More information about the Movitz-cvs mailing list