[Xcb] [PATCH] XCB-XML: Proposal for alignment padding

Evgeny M. Zubok evgeny.zubok at tochka.ru
Fri Mar 18 07:48:25 PDT 2011


Jamey Sharp <jamey at minilop.net> writes:

>> Suggested rule "(length of the request-so-far) modulo 4" needs strong
>> verification.

> That's not what I said. "Natural alignment" means, roughly, that the
> alignment of a field is the same as its size. The more complicated
> rules for structures and lists come from needing to ensure that each
> primitive field inside them is appropriately aligned, without using
> different padding in different contexts.

Yes, now I see. That's my misunderstanding. I was always considering the
size of pad only as a function of previous field(s), not also as a
function of type of field that followed the pad. The "natural alignment"
rule requires further thinking from me. :)

> It would be great to find out if the natural alignment rule breaks on
> any X extension, but my bet is that it's valid everywhere.

When I was writing the patch, I had verified all extensions and had
selected and patched only those requests and structures that required a
conditional padding (the list is in my orginal post with patch). So, a
first step is to verify that list.



More information about the Xcb mailing list