[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10668: FFI: ‘set-pointer-finalizer!’ overrides the previous finalize

From: Andy Wingo
Subject: bug#10668: FFI: ‘set-pointer-finalizer!’ overrides the previous finalizer
Date: Fri, 06 Jul 2012 20:26:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

On Mon 30 Jan 2012 23:31, address@hidden (Ludovic Courtès) writes:

> The ‘set-pointer-finalizer!’ procedure is harmful because it erases any
> previously set finalizer.
> Said finalizer could come from a guardian:
>    (define ptr (make-pointer 123))
>    (define g (make-guardian))
>    (g ptr)
>    (set-pointer-finalizer! ptr (dynamic-func "scm_is_pair" (dynamic-link)))
>    (set! ptr #f)
>    (gc)
>    (g)          ;; Should return PTR.
>    => #f

This has worked since 75ba64d6797f5857cc9885eb753126119a8c8b68.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]