- (if (> ,vector-len ,temp-len)
- (setf ,temp (make-array (max ,vector-len
- (min most-positive-fixnum
- (+ ,temp-len ,temp-len))))
- *merge-sort-temp-vector* ,temp))
- ;; rebind, in case PRED or KEY calls STABLE-SORT
+ (when (> ,vector-len ,temp-len)
+ (setf ,temp (make-array (max ,vector-len
+ (min (truncate array-dimension-limit 2)
+ (logand most-positive-fixnum (+ ,temp-len ,temp-len)))))
+ *merge-sort-temp-vector* ,temp))
+ ;; Rebind, in case PRED or KEY calls STABLE-SORT. This is also
+ ;; interrupt safe: we bind before we put any data of our own in
+ ;; the temp vector.