X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/a75fc933fb4fccfc8ea1c1c5349bc5d77d74f4f8..ce96411b2713dc32ac49c9c760c96610971904bf:/gffi/proxy.lisp diff --git a/gffi/proxy.lisp b/gffi/proxy.lisp index b3802b7..4600bf0 100644 --- a/gffi/proxy.lisp +++ b/gffi/proxy.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: proxy.lisp,v 1.6 2007/01/12 10:26:44 espen Exp $ +;; $Id: proxy.lisp,v 1.9 2007/06/20 11:13:45 espen Exp $ (in-package "GFFI") @@ -87,7 +87,7 @@ (defvar *foreign-instance-locations* (make-hash-table #+clisp :weak #+sbcl :weakness :key)) -;; TODO: add a ref-counted-proxy subclass + (eval-when (:compile-toplevel :load-toplevel :execute) (defclass proxy (virtual-slots-object) (#?-(or (sbcl>= 0 9 17) (featurep :clisp))(%location :special t :type pointer)) @@ -167,6 +167,7 @@ ;; :FINALZIE given to MAKE-PROXY-INSTANCE or non NIL if the proxy was ;; created with MAKE-INSTANCE (defmethod invalidate-instance ((instance proxy) &optional finalize-p) + #+clisp(declare (ignore finalize-p)) (remove-cached-instance (foreign-location instance)) #+(or sbcl cmu) (progn @@ -301,6 +302,8 @@ #'(lambda (value object) (unless writer (setq writer (mkbinding setter nil 'pointer type))) + ;; First argument in foreign setters is the object and second + ;; is value (funcall writer (foreign-location object) value))) (call-next-method)))