0.9.9.27:
[sbcl.git] / src / code / target-hash-table.lisp
index b0cf137..83fd171 100644 (file)
 (defmacro with-spinlock-and-without-gcing ((spinlock) &body body)
   #!-sb-thread
   (declare (ignore spinlock))
-  `(unwind-protect
-        (let ((*gc-inhibit* t))
-          #!+sb-thread
-          (sb!thread::get-spinlock ,spinlock)
-          ,@body)
-     #!+sb-thread
-     (sb!thread::release-spinlock ,spinlock)
-     ;; the test is racy, but it can err only on the overeager side
-     (sb!kernel::maybe-handle-pending-gc)))
+  (with-unique-names (old-gc-inhibit)
+    `(let ((,old-gc-inhibit *gc-inhibit*)
+           (*gc-inhibit* t))
+       (unwind-protect
+            (progn
+              #!+sb-thread
+              (sb!thread::get-spinlock ,spinlock)
+              ,@body)
+         #!+sb-thread
+         (sb!thread::release-spinlock ,spinlock)
+         (let ((*gc-inhibit* ,old-gc-inhibit))
+           ;; the test is racy, but it can err only on the overeager side
+           (sb!kernel::maybe-handle-pending-gc))))))
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defconstant max-hash sb!xc:most-positive-fixnum))
     (setf (hash-table-next-vector table) new-next-vector)
     (setf (hash-table-hash-vector table) new-hash-vector)
     ;; Shrink the old vectors to 0 size to help the conservative GC.
-    (shrink-vector old-kv-vector 0)
-    (shrink-vector old-index-vector 0)
-    (shrink-vector old-next-vector 0)
+    (%shrink-vector old-kv-vector 0)
+    (%shrink-vector old-index-vector 0)
+    (%shrink-vector old-next-vector 0)
     (when old-hash-vector
-      (shrink-vector old-hash-vector 0))
+      (%shrink-vector old-hash-vector 0))
     (setf (hash-table-rehash-trigger table) new-size))
   (values))