1 ;;;; weak pointer support
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package "SB!IMPL")
14 (defun make-weak-pointer (object)
15 "Allocate and return a weak pointer which points to OBJECT."
16 (make-weak-pointer object
))
18 #!-sb-fluid
(declaim (inline weak-pointer-value
))
19 (defun weak-pointer-value (weak-pointer)
20 "If WEAK-POINTER is valid, return the value of WEAK-POINTER and T.
21 If the referent of WEAK-POINTER has been garbage collected,
22 returns the values NIL and NIL."
23 (declare (type weak-pointer weak-pointer
))
24 (let ((value (sb!vm
::%weak-pointer-value weak-pointer
)))
25 (if (sb!vm
::unbound-marker-p value
)