Reduce O(n^2) operation to O(n)
[sbcl.git] / tests / finalize.test.sh
blob46afb7a0d8e643090aa7a5b9ab6bbf671bfea58f
1 . ./subr.sh
3 # This was failing with:
4 # Verify after GC(6) [immobile]
5 # Ptr 0x1001100c9f @ 503c1028 (lispobj 503c1003,pg-1) sees junk
6 # Ptr 0x1001100ebf @ 503c10a8 (lispobj 503c1083,pg-1) sees junk
7 # Ptr 0x100110102f @ 503c1128 (lispobj 503c1103,pg-1) sees junk
8 # ...
9 run_sbcl <<EOF
10 (setf (extern-alien "verify_gens" char) 0)
11 ;; simple-streams causes invalidation of many layouts
12 ;; that are at low addresses, like for FUNDAMENTAL-STREAM
13 (require :sb-simple-streams)
14 (defun foo ()
15 ;; we need a *lot* of finalizers for cull_weak_hash_tables
16 ;; to use up so much dynamic space that the mark bit
17 ;; calculation would go wrong
18 (dotimes (i 50000)
19 (finalize (cons i i) (lambda ()))))
20 (compile 'foo)
21 (foo)
22 (gc :gen 7)
23 EOF
25 exit $EXIT_TEST_WIN