[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size-of instance



At 11:24 AM 5/18/95, Shannon V Spires wrote:

>(defmethod sizeof ((me standard-object))
>  (* 8 (uvsize me)))

That's correct if there are an odd number of slots. If there
are an even number, however, it will be low by 4 bytes.
It really should be:

(defmethod sizeof ((me standard-object))
  (+ 8 (* 8 (ceiling (uvsize me) 2))))

MCL 3.0 has 4 bytes less vector overhead, so for MCL 3.0
it is:

(defmethod sizeof-3.0 ((me standard-object))
   (+ 8 (* 8 (ceiling (1- (uvsize me)) 2))))