X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ffinal.lisp;h=cfa36f1dba686f94c4daae37f504563c9fab543e;hb=4ec0d70e08ea4b512d45ddbd6c82e8f6a91a914f;hp=fc807f47aa3e644a54cf50cb97887d6b62347501;hpb=a6e22347785e8ce3eaf13013cfc69d6aac9c8c0e;p=sbcl.git diff --git a/src/code/final.lisp b/src/code/final.lisp index fc807f4..cfa36f1 100644 --- a/src/code/final.lisp +++ b/src/code/final.lisp @@ -41,19 +41,21 @@ signalled in whichever thread the FUNCTION was called in. Examples: - ;;; good (assumes RELEASE-HANDLE is re-entrant) + ;;; GOOD, assuming RELEASE-HANDLE is re-entrant. (let* ((handle (get-handle)) (object (make-object handle))) (finalize object (lambda () (release-handle handle))) object) - ;;; bad, finalizer refers to object being finalized, causing - ;;; it to be retained indefinitely + ;;; BAD, finalizer refers to object being finalized, causing + ;;; it to be retained indefinitely! (let* ((handle (get-handle)) (object (make-object handle))) - (finalize object (lambda () (release-handle (object-handle object))))) + (finalize object + (lambda () + (release-handle (object-handle object))))) - ;;; bad, not re-entrant + ;;; BAD, not re-entrant! (defvar *rec* nil) (defun oops () @@ -64,7 +66,7 @@ Examples: (progn (finalize \"oops\" #'oops) - (oops)) ; causes GC and re-entry to #'oops due to the finalizer + (oops)) ; GC causes re-entry to #'oops due to the finalizer ; -> ERROR, caught, WARNING signalled" (unless object (error "Cannot finalize NIL."))