diff --git a/collects/ffi/unsafe.rkt b/collects/ffi/unsafe.rkt index 5852cf7c8f..93bb391f85 100644 --- a/collects/ffi/unsafe.rkt +++ b/collects/ffi/unsafe.rkt @@ -446,7 +446,7 @@ (lambda (x) (and x (let ([cb (ffi-callback (wrap x) itypes otype abi atomic? async-apply)]) - (cond [(eq? keep #t) (hash-set! held-callbacks x cb)] + (cond [(eq? keep #t) (hash-set! held-callbacks x (make-ephemeron x cb))] [(box? keep) (let ([x (unbox keep)]) (set-box! keep diff --git a/collects/ffi/unsafe/try-atomic.rkt b/collects/ffi/unsafe/try-atomic.rkt index 68f2f09043..c0c860e45d 100644 --- a/collects/ffi/unsafe/try-atomic.rkt +++ b/collects/ffi/unsafe/try-atomic.rkt @@ -67,7 +67,7 @@ (define (can-try-atomic?) (and (freezer-box) (not (in-try-atomic?)))) ;; prevent GC of handler while it's installed: -(define saved-ptrs (make-hash)) +(define saved-ptrs (make-hasheq)) (define (try-atomic thunk default #:should-give-up? [should-give-up?