xserver: Cleaning up memory allocation functions and macros
Magnus.Vigerlof at home.se
Sun Apr 29 08:39:20 PDT 2007
On söndag 29 april 2007, Eamon Walsh wrote:
> >>> * xnf* will be implemented as wrapper functions that will call
> >>> FatalError if the libc-functions returned NULL when they shouldn't
> >>> (i.e. more or less kept as-is). NOTE: Avoid these, use proper
> >>> error-propagation instead (calling these should be considered a BUG).
> >> Indeed. You can just mark these as _X_DEPRECATED and the compiler will
> >> complain every time.
> > And it's not that many really (200-400 places, thought it would be
> > more.). But the tricky part will be to refactor the code so it'll handle
> > the situation instead without breaking the interface. I'll change the
> > call to one of these if proper checking is not made (and I can't fix it),
> > so there will be some more, but we'll know where they are at least.
> Calls which would break the interface could be changed to FatalError
> explicitly as a temporary measure, with an XXX or TODO to fix the
> interface later.
Mmm... Will code marked with one of those get any attention? The ones at the
variable 'Must_have_memory' seems to have been there a very long time. I'd
prefer if the compiler bug us, that way a proper patch for the thing is bound
to be made faster than if we just hide it.
More information about the xorg