[Openmcl-devel] object classes and nib files (a clue and a puzzle)
alex crain
alexcrain at mail.widgetworks.com
Mon Jan 3 11:29:19 PST 2005
FYI, the code that I posted doesn't actually work, the correct code is:
(defun %objc-domain-slots-vector (p)
(let* ((type (%macptr-type p))
(flags (ldb objc-type-flags type))
(index (ldb objc-type-index type)))
(declare (fixnum type flags index))
(ecase flags
(#.objc-flag-instance (or (gethash p *objc-object-slot-vectors*)
; try to allocate the slot vector on demand
(let* ((raw-ptr (raw-macptr-for-instance p))
(slot-vector (create-foreign-instance-slot-vector (class-of
p))))
(when slot-vector
(setf (slot-vector.instance slot-vector) raw-ptr)
(setf (gethash raw-ptr *objc-object-slot-vectors*) slot-vector))
(register-canonical-objc-instance p raw-ptr)
slot-vector)
(error "~s has no slots." p)))
(#.objc-flag-class (id->objc-class-slots-vector index))
(#.objc-flag-metaclass (id->objc-metaclass-slots-vector index)))))
More information about the Openmcl-devel
mailing list