X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-hash-table.lisp;h=83fd171eb3e0d5d154dc904b406f2d68efe0607b;hb=942e45e3bb73fd55786e4a0ab4590324063c0c89;hp=b0cf137929cd4d960d1029e36a2da7f0004c2116;hpb=54e97796e29cb89892dd30c8cb8c5e9d0a870f94;p=sbcl.git diff --git a/src/code/target-hash-table.lisp b/src/code/target-hash-table.lisp index b0cf137..83fd171 100644 --- a/src/code/target-hash-table.lisp +++ b/src/code/target-hash-table.lisp @@ -21,15 +21,19 @@ (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)) @@ -339,11 +343,11 @@ (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))