[PATH] XQuartz: Drop calls to alloca

Adam Jackson ajax at nwnk.net
Tue Dec 1 07:08:24 PST 2009


On Mon, 2009-11-30 at 15:56 -0800, Keith Packard wrote:
> On Tue, 1 Dec 2009 10:45:01 +1100, Daniel Stone <daniel at fooishbar.org> wrote:
> 
> > Anyone have any objection to declaring xalloc/xfree dead -- at least in
> > the server -- and moving to plain old malloc/calloc/strdup/.../free?
> 
> The only issue is back-porting patches to old X server versions; this
> kind of giant pile of churn makes that harder. If no-one cares about
> that issue, I'm up for reducing our arbitrary layers of useless abstraction.

I don't care about the added churn at all.  Chopper Reid has advice
relevant to this situation.

It's not the only issue though.  Those are currently driver ABI.  We
should probably still implement them and decorate them with
_X_DEPRECATED for a cycle until the drivers catch up.

Also, Xcalloc and xcalloc have gratuitously different signatures.
Anyone actually calling Xcalloc needs to be fixed to pass two arguments
to calloc.  (This is the whole point of calloc: it has two arguments so
it can check that the multiplication doesn't overflow.  Sigh, X.)

It also doesn't address the xnf* variants.  Unlike most programs the X
server actually has a valid case for checking for malloc failure: we
_do_ run into address space exhaustion, and we should reasonably throw
BadAlloc back to the client rather than die.  So we should probably keep
them, and probably fix XNFcalloc() to take two arguments.  Do we rename
them too?  nfcalloc()?

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20091201/1cd2947a/attachment.pgp 


More information about the xorg-devel mailing list