[Xcb] XCB-XML: Specification for alignments?

Peter Harris pharris at opentext.com
Mon Nov 1 08:49:52 PDT 2010


On 2010-10-31 19:43, Evgeny M. Zubok wrote:
> 
> What do you think about new tag for XCB-XML specification to explicitly
> insert the alignment bytes into requests, replies, events and
> structures?

I think it's a great idea. XCB-XML should always explicitly pad wherever
there is padding. There was an effort to spell out all the static pads a
while back, and I think we've got them all now. Unfortunately, I haven't
had the time to look at dynamic padding in sufficient detail myself.

> For example
> 
> Unused bytes, 4 byte align at this place:
> 
> <align><value>4</value></align> 

Or even <pad align="4" /> (but that's just bikeshedding; if you're
implementing it, you get to pick the syntax).

There is at least one place where we already spell this out the long way
(grep for alignment_pad in xf86vidmode.xml). Ick.

> If the code generator doesn't need this information (like the XCB
> implementation), it will free to omit the <align> tag/attribute.

No, I think it will benefit from this information being explicitly
spelled out. It reduces the need for implicit rules, and it simplifies
case(s) where we already do this the hard way (see alignment_pad again,
if you think your stomach can handle it).

Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the Xcb mailing list