[PATCH 2/3] dix: Shrink PropertyRec on LP64

Daniel Stone daniel at fooishbar.org
Wed Mar 9 03:51:29 PST 2011


On Tue, Mar 08, 2011 at 03:17:09PM -0500, Adam Jackson wrote:
> On Tue, 2011-03-08 at 19:37 +0000, Daniel Stone wrote:
> > Being really pedantic again, can't these two be uint8_t or something?
> > You've just grown format from 16 to 32 bytes. :P
> 
> size pretty much needs to be uint32_t, MAX_BIG_REQUEST_SIZE is 4M so
> even if you're using format32 you're looking at (1 << 20).  Once you've
> got that, you're sticking format between two uint32_t, so making it
> uint8_t would just give you 24 bits of hole.
> 
> If you really wanted to assume too much about bigreq sizing and/or throw
> BadAlloc on excessively large properties, you could probably smash
> format into the high bits of size, which would take you from 28 to 24
> bytes per on ILP32, but wouldn't win you anything on LP64 (either you'd
> be making a hole so the pointers are aligned, or you'd move it to the
> end of the struct and still have padding off the end due to ABI rules).
> 
> Which seems... a little dirty, but if someone really wants that memory
> back, I guess that's a thing we could do.

Fair play -- have my R-b.  You've earned it. ;)

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110309/61df9f35/attachment-0001.pgp>


More information about the xorg-devel mailing list