-(defmethod compute-foreign-size ((class struct-class))
- (let ((size (loop
- for slotd in (class-slots class)
- when (eq (slot-definition-allocation slotd) :alien)
- maximize (+
- (slot-definition-offset slotd)
- (size-of (slot-definition-type slotd))))))
- (+ size (mod size +struct-alignmen+))))
+(defmethod compute-slots :around ((class struct-class))
+ (let ((slots (call-next-method)))
+ (when (and
+ #-sbcl>=0.9.8(class-finalized-p class) #+sbc098 t
+ (not (slot-boundp class 'size)))
+ (let ((size (loop
+ for slotd in slots
+ when (eq (slot-definition-allocation slotd) :alien)
+ maximize (+
+ (slot-definition-offset slotd)
+ (size-of (slot-definition-type slotd))))))
+ (setf (slot-value class 'size) (+ size (mod size +struct-alignmen+)))))
+ slots))