mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-24 21:41:29 -08:00
tests: finalization shouldn't use special variabile
This commit is contained in:
parent
42eed437d1
commit
6cd9dcf6b6
1 changed files with 19 additions and 21 deletions
|
|
@ -192,27 +192,25 @@
|
|||
;;; The following code tests that at least three objects are finalized.
|
||||
;;;
|
||||
;;; Note: this test fails in multithreaded mode. GC takes too long!
|
||||
(ext:with-clean-symbols (*all-tags*)
|
||||
(test cmp.0009.finalization
|
||||
(is-equal '(0 1 2 3 4)
|
||||
(let ((*all-tags* '()))
|
||||
(declare (special *all-tags*))
|
||||
(flet ((custom-finalizer (tag)
|
||||
#'(lambda (o)
|
||||
(declare (ignore o))
|
||||
;; XXX
|
||||
(push tag *all-tags*))))
|
||||
(let ((a '()))
|
||||
(dotimes (i 5)
|
||||
(let ((x (cons i i)))
|
||||
(si::set-finalizer x (custom-finalizer i))
|
||||
(push x a))))
|
||||
(sleep 1) ; mitigate gc being slow
|
||||
(dotimes (j 100)
|
||||
(dotimes (i 10000)
|
||||
(cons 1.0 1.0))
|
||||
(si::gc t)))
|
||||
(sort *all-tags* #'<)))))
|
||||
(test cmp.0009.finalization
|
||||
(is-equal '(0 1 2 3 4)
|
||||
(let ((all-tags))
|
||||
(flet ((custom-finalizer (tag)
|
||||
#'(lambda (o)
|
||||
(declare (ignore o))
|
||||
(push tag all-tags))))
|
||||
(let ((a '()))
|
||||
(dotimes (i 5)
|
||||
(let ((x (cons i i)))
|
||||
(si::set-finalizer x (custom-finalizer i))
|
||||
(push x a))))
|
||||
;; mitigate GC slowness
|
||||
(sleep 1)
|
||||
(dotimes (j 100)
|
||||
(dotimes (i 10000)
|
||||
(cons 1.0 1.0))
|
||||
(ext:gc t)))
|
||||
(sort all-tags #'<))))
|
||||
|
||||
;;; Date: 8/10/2006 (Dustin Long)
|
||||
;;; Fixed: 10/10/2006 (Dustin Long)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue