0.8.6.15:
authorChristophe Rhodes <csr21@cam.ac.uk>
Sat, 29 Nov 2003 22:20:37 +0000 (22:20 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Sat, 29 Nov 2003 22:20:37 +0000 (22:20 +0000)
        Yay PFD real tests!
        ... REHASH-THRESHOLD may be specified to be of type (REAL 0 1)
                [ aside: (REAL (0) 1) would be much preferred for
                aesthetic reasons ] but we'd better not divide by it
                unconditionally, because otherwise confusion ensues
        ... define a constant below which we shall not go

NEWS
src/code/target-hash-table.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 49e3136..40a49d0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2202,6 +2202,10 @@ changes in sbcl-0.8.7 relative to sbcl-0.8.6:
   * bug fix: buffered :DIRECTION :IO streams are less likely to become
     confused about their position.  (thanks to Adam Warner and Gerd 
     Moellmann)
+  * fixed some bugs revealed by Paul Dietz' test suite:
+    ** the value of the :REHASH-THRESHOLD argument to MAKE-HASH-TABLE
+       is ignored if it is too small, rather than propagating through
+       to cause DIVIDE-BY-ZERO or FLOATING-POINT-OVERFLOW errors.
 
 planned incompatible changes in 0.8.x:
   * (not done yet, but planned:) When the profiling interface settles
index 0cdd509..26d751e 100644 (file)
@@ -81,6 +81,7 @@
 ;;;; construction and simple accessors
 
 (defconstant +min-hash-table-size+ 16)
+(defconstant +min-hash-table-rehash-threshold+ (float 1/16 1.0))
 
 (defun make-hash-table (&key (test 'eql)
                             (size +min-hash-table-size+)
                      (min size
                           ;; SIZE is just a hint, so if the user asks
                           ;; for a SIZE which'd be too big for us to
-                          ;; easily implement, we bump it down.
-                          (floor array-dimension-limit 16))))
+                          ;; easily implement, we bump it down.
+                          (floor array-dimension-limit 1024))))
           (rehash-size (if (integerp rehash-size)
                            rehash-size
                            (float rehash-size 1.0)))
           ;; FIXME: Original REHASH-THRESHOLD default should be 1.0,
           ;; not 1, to make it easier for the compiler to avoid
           ;; boxing.
-          (rehash-threshold (float rehash-threshold 1.0))
+          (rehash-threshold (max +min-hash-table-rehash-threshold+
+                                 (float rehash-threshold 1.0)))
           (size+1 (1+ size))           ; The first element is not usable.
            ;; KLUDGE: The most natural way of expressing the below is
            ;; (round (/ (float size+1) rehash-threshold)), and indeed
index 051ada2..9646056 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.6.14"
+"0.8.6.15"