1.0.18.7: just one POWER-OF-TWO-CEILING, thank you
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 30 Jun 2008 10:33:57 +0000 (10:33 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 30 Jun 2008 10:33:57 +0000 (10:33 +0000)
 * We had two, of which CEIL-POWER-OF-TWO with arguments that already
   were powers of two returned the *next* power of two, and not the
   argument, whereas POWER-OF-TWO-CEILING returned the argument if
   it already was a power of two.

   As far as I can tell returning the argument is fine in those case
   in places where CEIL-POWER-OF-TWO was used, so replace it with
   POWER-OF-TWO-CEILING -- which really doesn't have to be inline.

NEWS
package-data-list.lisp-expr
src/code/target-extensions.lisp
src/code/target-hash-table.lisp
src/pcl/cache.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 0af2e7e..382cc2e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,7 @@ changes in sbcl-1.0.19 relative to 1.0.18:
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** interval arithmetic during type derivation used inexact integer
        to single-float coercions.
-    ** artihmetic operations involving large integers and single
+    ** arithmetic operations involving large integers and single
        floats give the same results in compiled and interpreted code.
     ** deriving the result type of COERCE no longer signals an error
        if the derived type of the second argument is a MEMBER type
index 7143b05..1f0f388 100644 (file)
@@ -930,6 +930,7 @@ possibly temporariliy, because it might be used internally."
                "BIT-VECTOR-="
                "READ-EVALUATED-FORM"
                "MAKE-UNPRINTABLE-OBJECT"
+               "POWER-OF-TWO-CEILING"
 
                ;; ..and macros..
                "COLLECT"
index f65e25d..6963eeb 100644 (file)
@@ -119,3 +119,8 @@ exit(3) directly will circumvent these hooks.")
                   (%shrink-vector string size)
                   string)))
          ,@body))))
+
+;;; The smallest power of two that is equal to or greater than X.
+(defun power-of-two-ceiling (x)
+  (declare (index x))
+  (ash 1 (integer-length (1- x))))
index bdb5514..2a92616 100644 (file)
     (t
      (eq-hash key))))
 
-(defun ceil-power-of-two (num)
-  (declare (type index num))
-  (ash 1 (integer-length num)))
-
 (declaim (inline index-for-hashing))
 (defun index-for-hashing (hash length)
   (declare (type hash hash length))
            ;; Note that this has not yet been audited for
            ;; correctness. It just seems to work. -- CSR, 2002-11-02
            (scaled-size (truncate (/ (float size+1) rehash-threshold)))
-           (length (ceil-power-of-two (max scaled-size
-                                           (1+ +min-hash-table-size+))))
+           (length (power-of-two-ceiling (max scaled-size
+                                              (1+ +min-hash-table-size+))))
            (index-vector (make-array length
                                      :element-type
                                      '(unsigned-byte #.sb!vm:n-word-bits)
@@ -326,7 +322,7 @@ multiple threads accessing the same hash-table without locking."
          (old-hash-vector (hash-table-hash-vector table))
          (old-size (length old-next-vector))
          (new-size
-          (ceil-power-of-two
+          (power-of-two-ceiling
            (let ((rehash-size (hash-table-rehash-size table)))
              (etypecase rehash-size
                (fixnum
index e7f60e4..73c197b 100644 (file)
   ;; bits at the low end.
   (logand (1- vector-length) (- line-size)))
 
-;;; The smallest power of two that is equal to or greater then X.
-(declaim (inline power-of-two-ceiling))
-(defun power-of-two-ceiling (x)
-  (ash 1 (integer-length (1- x))))
-
 (defun cache-statistics (cache)
   (let* ((vector (cache-vector cache))
          (size (length vector))
index 20c2f2b..a563aa1 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".)
-"1.0.18.6"
+"1.0.18.7"