Chez Scheme: add test case for recent continuation GC repair
This commit is contained in:
parent
2742962988
commit
1260f888c9
|
@ -4822,6 +4822,30 @@
|
||||||
;; Check that the GC update the reference to `key2` in `e`:
|
;; Check that the GC update the reference to `key2` in `e`:
|
||||||
(eq? (car e) key2)))))))
|
(eq? (car e) key2)))))))
|
||||||
|
|
||||||
|
;; ----------------------------------------
|
||||||
|
;; Check GC interaction with zero-sized contnuations - unlikely
|
||||||
|
;; to crash even if things are wrong, but it's worth a try
|
||||||
|
|
||||||
|
(let ()
|
||||||
|
(define (loop i)
|
||||||
|
(if (zero? i)
|
||||||
|
(call/cc (lambda (k) (k '())))
|
||||||
|
(let ([keeps (loop (sub1 i))])
|
||||||
|
(call/cc
|
||||||
|
(lambda (k)
|
||||||
|
(cons k keeps))))))
|
||||||
|
|
||||||
|
(with-interrupts-disabled
|
||||||
|
(collect 0)
|
||||||
|
(let ([keeps (filter (lambda (c)
|
||||||
|
(eqv? 0 (#%$continuation-stack-clength c)))
|
||||||
|
(loop 1000))])
|
||||||
|
;; The `keeps` list is probably non-empty
|
||||||
|
(collect 0 0)
|
||||||
|
(collect 0 0)
|
||||||
|
(keep-live keeps)
|
||||||
|
#t)))
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
;; Check fasl:
|
;; Check fasl:
|
||||||
(let ([s (gensym)])
|
(let ([s (gensym)])
|
||||||
|
|
|
@ -12962,6 +12962,8 @@
|
||||||
,(if 1-shot?
|
,(if 1-shot?
|
||||||
`(immediate ,(constant opportunistic-1-shot-flag))
|
`(immediate ,(constant opportunistic-1-shot-flag))
|
||||||
%ac0))
|
%ac0))
|
||||||
|
;; NB: clength will be 0 if we're reifying to hide a continuation link
|
||||||
|
;; where the attachments field is #f. Make sure the GC is ok with that.
|
||||||
(set! ,(%mref ,%xp ,(constant continuation-stack-clength-disp)) ,%ac0)
|
(set! ,(%mref ,%xp ,(constant continuation-stack-clength-disp)) ,%ac0)
|
||||||
(set! ,(%tc-ref scheme-stack-size) ,(%inline - ,(%tc-ref scheme-stack-size) ,%ac0))
|
(set! ,(%tc-ref scheme-stack-size) ,(%inline - ,(%tc-ref scheme-stack-size) ,%ac0))
|
||||||
,(finish %xp)))]
|
,(finish %xp)))]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user