anchor.diff:  (defgeneric invalidate-instance (instance &optional finalize-p))
   (defgeneric allocate-foreign (object &key &allow-other-keys))
   
  -(defun foreign-location (instance)
  -  #-clisp(slot-value instance 'location)
  -  #+clisp(gethash instance *foreign-instance-locations*))
  -
  -(defun (setf foreign-location) (location instance)
  -  #-clisp(setf (slot-value instance 'location) location)
  -  #+clisp(setf (gethash instance *foreign-instance-locations*) location))
  -
  -(defun proxy-valid-p (instance)
  -  #-clisp(slot-boundp instance 'location)
  -  #+clisp(and (gethash instance *foreign-instance-locations*) t))
  +#?-(or (sbcl>= 0 9 17) (featurep :clisp))
  +(progn
  +  (defun foreign-location (instance)
  +    (slot-value instance '%location))
  +
  +  (defun (setf foreign-location) (location instance)
  +    (setf (slot-value instance '%location) location))
  +  
  +  (defun proxy-valid-p (instance)
  +    (slot-boundp instance '%location)))
  +  
  +#?(or (sbcl>= 0 9 17) (featurep :clisp))
  +(progn
  +  (defun foreign-location (instance)
  +    (gethash instance *foreign-instance-locations*))
  +
  +  (defun (setf foreign-location) (location instance)
  +    (setf (gethash instance *foreign-instance-locations*) location))
  +
  +  (defun proxy-valid-p (instance)
  +    (and (gethash instance *foreign-instance-locations*) t)))
  +
   
   (defmethod reference-function ((name symbol))
     (reference-function (find-class name)))
  
positive.code: ;; 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.4 2006-08-16 12:09:03 espen Exp $
  
  (in-package "GFFI")
  
  
negative.code: 
  ;;;; Proxy for alien instances
  
  #?(or (sbcl>= 0 9 17) (featurep :clisp))
  (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))
      (:metaclass virtual-slots-class)))
  
  (defgeneric instance-finalizer (instance))
  