Re: Stable cvs version for 2.4

Jasmine Strong
2002-09-04T15:33:32Z

On Wed, 4 Sep 2002, David Woodhouse wrote:

> jasmine@hex.linuxgrrls.org said:
> > > How about we add 1 byte which contains up to 8 bit fields?
> > Adding a byte will destroy the alignment. you'd have to add a whole
> > word.
>
> Er, what alignment?

The alignment of the structure. Either it's a whole multiple of words or
it isn't.

> Either the CPU or something else assumes and requires alignment, in which
> case we know that we can happily abuse the low-bit of the address.

Yes, that's what I said.

> Or it doesn't, in which case we can add our single byte and use it with
> impunity.

I said that too...

> And yes, Allen's right that if we're going to add a single byte
> to the structure we should just put the colour information into that
> instead of using it to align the pointer so that we can abuse the low bit
> of the pointer :)

Yep. I agree wholeheartedly. I would be happiest with having
compile-time options for the three different methods- on many
architectures writing a byte is much slower than writing a word, so on
those architectures it may be better to use an int (the current method).
On other architectures addresses are word aligned and one may abuse the
pointers with impunity (David's suggested method), and on others pointers
aren't always aligned and a byte write is nice and fast (the method using
a flags byte.)

Jas.