cs: revert custodian change that creates a leak

Reverts the repair attempt in 91abd020d1. The problem with switching
to a "late" reference is that it's based on ordered finalization in
Racket CS, which doesn't work on values that can refer back to
themselves.
This commit is contained in:
Matthew Flatt 2020-08-16 06:29:18 -06:00
parent f42ddd2853
commit bf06162210
3 changed files with 21 additions and 19 deletions

View File

@ -17750,23 +17750,25 @@
(unsafe-end-atomic)))))
(define cache-save!
(lambda (c_0 enc_0 get_0 update!_0)
(begin
(unsafe-start-atomic)
(begin0
(begin
(if (equal? enc_0 (cache-enc (unsafe-place-local-ref cell.1$5)))
(void)
(begin
(cache-clear! cache-to set-cache-to!)
(cache-clear! cache-to2 set-cache-to2!)
(cache-clear! cache-from set-cache-from!)
(set-cache-enc! (unsafe-place-local-ref cell.1$5) enc_0)))
(if (|#%app| get_0 (unsafe-place-local-ref cell.1$5))
(1/bytes-close-converter c_0)
(begin
(bytes-reset-converter c_0)
(|#%app| update!_0 (unsafe-place-local-ref cell.1$5) c_0))))
(unsafe-end-atomic)))))
(if c_0
(begin
(unsafe-start-atomic)
(begin0
(begin
(if (equal? enc_0 (cache-enc (unsafe-place-local-ref cell.1$5)))
(void)
(begin
(cache-clear! cache-to set-cache-to!)
(cache-clear! cache-to2 set-cache-to2!)
(cache-clear! cache-from set-cache-from!)
(set-cache-enc! (unsafe-place-local-ref cell.1$5) enc_0)))
(if (|#%app| get_0 (unsafe-place-local-ref cell.1$5))
(1/bytes-close-converter c_0)
(begin
(bytes-reset-converter c_0)
(|#%app| update!_0 (unsafe-place-local-ref cell.1$5) c_0))))
(unsafe-end-atomic)))
(void))))
(define bytes-open-converter/cached-to
(lambda (enc_0)
(let ((or-part_0 (cache-lookup! enc_0 cache-to set-cache-to!)))

View File

@ -5679,7 +5679,7 @@
#f
(let ((we_0
(if (not weak?7_0)
(|#%app| host:make-late-will-executor void)
(|#%app| host:make-will-executor void)
#f)))
(begin
(let ((app_0 (custodian-children cust12_0)))

View File

@ -122,7 +122,7 @@
[(custodian-shut-down? cust) #f]
[else
(define we (and (not weak?)
(host:make-late-will-executor void)))
(host:make-will-executor void)))
(hash-set! (custodian-children cust)
obj
(cond