Changeset 6610


Ignore:
Timestamp:
May 25, 2007, 5:10:12 AM (18 years ago)
Author:
Gary Byers
Message:

ALLOCATE-INSTANCE: don't make a slot-vector if #/init method made one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ide-1.0/ccl/examples/objc-clos.lisp

    r6248 r6610  
    185185                                    ; try to allocate the slot vector on demand
    186186                                    (let* ((raw-ptr (raw-macptr-for-instance p))
    187                                            (slot-vector (create-foreign-instance-slot-vector (class-of
    188 p))))
     187                                           (slot-vector (create-foreign-instance-slot-vector (class-of p))))
    189188                                      (when slot-vector
    190189                                        (setf (slot-vector.instance slot-vector) raw-ptr)
     
    748747            (send-objc-init-message (allocate-objc-object class) ks vs))))
    749748    (unless (%null-ptr-p instance)
    750       (let* ((slot-vector (create-foreign-instance-slot-vector class)))
    751         (when slot-vector
    752           (let* ((raw-ptr (raw-macptr-for-instance instance)))
    753             (setf (slot-vector.instance slot-vector) raw-ptr)
    754             (setf (gethash raw-ptr *objc-object-slot-vectors*) slot-vector)
    755             (register-canonical-objc-instance instance raw-ptr)))))
     749      (or (gethash instance *objc-object-slot-vectors*)
     750          (let* ((slot-vector (create-foreign-instance-slot-vector class)))
     751            (when slot-vector
     752              (let* ((raw-ptr (raw-macptr-for-instance instance)))
     753                (setf (slot-vector.instance slot-vector) raw-ptr)
     754                (setf (gethash raw-ptr *objc-object-slot-vectors*) slot-vector)
     755                (register-canonical-objc-instance instance raw-ptr))))))
    756756    instance))
    757757
Note: See TracChangeset for help on using the changeset viewer.