[Xcb] size annotations for XML-XCB, and other tools

Jamey Sharp jamey at minilop.net
Thu Jun 15 12:50:27 PDT 2006


On Thu, Jun 15, 2006 at 02:10:30PM -0400, Jeremy A. Kolb wrote:
> On Thu, 15 Jun 2006, Jamey Sharp wrote:
> > Note that a fair amount of padding can't be automatically computed, as
> > far as I can tell, though some of it can. <pad bytes="5" /> appears once
> > or twice even though natural alignment only requires <pad bytes="1" />.
> 
> There are quite a few extension docs that list padding as an expression, I 
> guess that doesn't really help here though.

I think you'll find that all padding with expressions follows a LIST.
That case is not expressed in these protocol descriptions at all:
currently it's handled with a little bit of special C code. Making it
explicit for requests (as a result of size analysis) will help get a
performance improvement by reducing the number of iovecs passed to
XCBSendRequest and by extension reducing the number of times memcpy is
called.

> > Also, the large padding before <list>s in replies is, I think, not a
> > hard requirement so some extension might omit it eventually. Although
> > since none currently does, I guess I should auto-generate that padding
> > and we can add a <reply pad-end="false"> attribute or something later.
> 
> How do you mean 'not a hard requirement'?  Do you mean in the design?  

Yes. Every reply is padded that way, but AFAICT it's not required by the
protocol. I suspect it was harder to omit that padding in Xlib, since
_XReply treats the first 32 bytes as somewhat separate from the
remainder. It looks to me like the server doesn't have the same problem
though, and XCB certainly doesn't care.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060615/b3050770/attachment.pgp


More information about the Xcb mailing list