[squeak-dev] The Trunk: Kernel-nice.508.mcz

David T. Lewis lewis at mail.msen.com
Thu Oct 28 12:24:07 UTC 2010


On Thu, Oct 28, 2010 at 11:20:34AM +0300, Igor Stasenko wrote:
> On 27 October 2010 22:54, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> >
> > On Wed, Oct 27, 2010 at 7:43 AM, Bert Freudenberg <bert at freudenbergs.de>
> > wrote:
> >>
> >> But what do you call the elements in a variableWordSubclass in a 64 bit
> >> image then? Half-words? Because 64 bit words are not exposed at all in the
> >> image. Nowhere, AFAIK.
> >
> > I think the only sensible solution is to call them words and have them be
> > 32-bits in both 32-bit and 64-bit images. ??There's no necessary
> > correspondence between the size of an oop and the field-width of a
> > variableWordSubclass:. ??So we have variableByteSubclass: and
> > variableWordSubclass: with widths 1 byte and 4 bytes respectively. ??We could
> > conceivably add variableHalfWordSubclass: and variableDoubleWordSubclass:
> > for 2 bytes and 8 bytes field widths respectively.
> > Varying the width of any of the non-oop subclasses between the 32-bit and
> > 64-bit images will simply break applications because when porting code from
> > 64-bits to 32-bits values won't fit in the smaller 32-bit interpretation.
> > ??This is analogous to C's float and double datatypes on 32- and 64-bit
> > architectures. ??Irrespective of the system being 32- or 64-bit float is
> > 32-bit and double is 64-bit. ??So byte == 8 bits, halfWord == 16 bits, word
> > == 32 bits and doubleWord == 64 bits irrespective of the underlying width of
> > the machine.
> > Hence better names might be
> > variable8BitSubclass:
> > variable16BitSubclass:
> > variable32BitSubclass:
> > variable64BitSubclass:
> > because then one doesn't have to think.
> 
> +1
> 
> because i taught completely different 'word' sizes:
> byte - 8 bits
> word - 16 bits
> dword - 32 bits
> qword - 64 bits

+1

I agree, these would be better selector names.

Dave
 



More information about the Squeak-dev mailing list