Re: Stable cvs version for 2.4

David Woodhouse
2002-09-04T15:26:41Z

swahl@brecis.com said:
> But the assumption that using the lsb of the pointer will only break
> on archetectures that don't care about alignment may be a bad one.

Theoretically yes, but in practice no. It is of course possible that some
architectures will store in a 'pointer' something other than the actual
address to be put on the bus when accessing the data in question.

Linux doesn't run on any of that hardware, thankfully. And if it becomes a
problem, the pointer magic can be fixed then, and it'll be a drop in the
ocean of all the other now-broken assumptions that we have to fix :)

> I haven't looked at the code (shame on me...), but I thought I heard
> the word "tree" mentioned. :-) If this data structure is being used
> for speed, I have to ask if the extra masking instructions are a good
> trade off for the memory saved?

If you stick it in the rb_parent field, you don't have to mask it out
during lookup or insertion operations, only during rebalancing. Either way,
it's a lot faster than the linked list which I just replaced :)

--
dwmw2