+
+(defun stress-gc ()
+ (let* ((x (make-array (truncate (* 0.2 (dynamic-space-size))
+ sb-vm:n-word-bytes))))
+ (elt x 0)))
+
+(with-test (:name :bug-936304)
+ (gc :full t)
+ (time
+ (assert (eq :ok (handler-case
+ (progn
+ (loop repeat 50 do (stress-gc))
+ :ok)
+ (storage-condition ()
+ :oom))))))
+
+(with-test (:name :bug-981106)
+ (gc :full t)
+ (time
+ (assert (eq :ok
+ (handler-case
+ (dotimes (runs 100 :ok)
+ (let* ((n (truncate (dynamic-space-size) 1200))
+ (len (length
+ (with-output-to-string (string)
+ (dotimes (i n)
+ (write-sequence "hi there!" string))))))
+ (assert (eql len (* n (length "hi there!"))))))
+ (storage-condition ()
+ :oom))))))