From: Nikodemus Siivola Date: Thu, 17 May 2007 16:44:52 +0000 (+0000) Subject: 1.0.5.50: some compare-and-swap changes X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=8cd045dfd24638b1958f1507f944f249d2d2ccde;p=sbcl.git 1.0.5.50: some compare-and-swap changes * Since we have a non-threaded %INSTANCE-COMPARE-AND-SWAP on all platforms, define DEFINE-STRUCTURE-SLOT-COMPARE-AND-SWAP on non-threaded builds as well. * Bounds checking SIMPLE-VECTOR-COMPARE-AND-SWAP, plus tests. --- diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index c4fb513..79889f3 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -1455,6 +1455,7 @@ is a good idea, but see SB-SYS re. blurring of boundaries." "SIMPLE-ARRAY-SIGNED-BYTE-8-P" "SIMPLE-BASE-STRING-P" #!+sb-unicode "SIMPLE-CHARACTER-STRING-P" "SIMPLE-PACKAGE-ERROR" "SIMPLE-UNBOXED-ARRAY" + "SIMPLE-VECTOR-COMPARE-AND-SWAP" "SINGLE-FLOAT-BITS" "SINGLE-FLOAT-EXPONENT" "SINGLE-FLOAT-INT-EXPONENT" "SINGLE-FLOAT-SIGNIFICAND" "SINGLE-VALUE-TYPE" "SINGLE-VALUE-SPECIFIER-TYPE" diff --git a/src/code/array.lisp b/src/code/array.lisp index d569ad4..873a9b7 100644 --- a/src/code/array.lisp +++ b/src/code/array.lisp @@ -56,9 +56,12 @@ (values vector index)) (values array index))) -(defun %simple-vector-compare-and-swap (vector index old new) +(defun safe-simple-vector-compare-and-swap (vector index old new) #!+(or x86 x86-64) - (%simple-vector-compare-and-swap vector index old new) + (%simple-vector-compare-and-swap vector + (%check-bound vector (length vector) index) + old + new) #!-(or x86 x86-64) (let ((n-old (svref vector index))) (when (eq old n-old) diff --git a/src/code/late-extensions.lisp b/src/code/late-extensions.lisp index 52b45c6..7fed988 100644 --- a/src/code/late-extensions.lisp +++ b/src/code/late-extensions.lisp @@ -48,7 +48,6 @@ ;;; Used internally, but it would be nice to provide something ;;; like this for users as well. -#!+sb-thread (defmacro define-structure-slot-compare-and-swap (name &key structure slot) (let* ((dd (find-defstruct-description structure t)) diff --git a/version.lisp-expr b/version.lisp-expr index 47045ec..c389fa3 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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.5.49" +"1.0.5.50"