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

Re: Size-of instance



Bill St. Clair replied:
> 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))))
> 
> [another version was also given for MCL 3.0]

Thanks for the clarification, Bill. But the difference is more profound
than that. Your version of sizeof (above) agrees with the meter-consing result
for every example I've tried so far, while my version would actually
overestimate storage by a factor approaching 2 as the number of slots
grows large!

-- 
Shannon Spires
svspire@sandia.gov