About Xalloc()/Xfree() function used in liblbxutil library.
Bernardo Innocenti
bernie at codewiz.org
Sat Sep 15 21:15:34 PDT 2007
Tadashi Koike wrote:
> But I think when "Library and server implementations are separate"
> (reference: lib/liblbxutil/README), that dependence should be
> got rid of.
You could replace Xalloc() with malloc() and Xfree() with free().
The only functional difference is that Xalloc() aborts on failure,
while malloc() is _documented_ to return a NULL pointer on failure
(but on Linux, I guess the OOM will kick in first ;-)
I'd be in favor of killing these ugly leftovers from an ancient
age when OSes really sucked.
A less drastic approach would be to convert all code to use
xmalloc() and xcalloc() macro wrappers, which are a more common
idiom these days.
If the other X developers agree, I'd be glad to post a patch to
do this.
--
// Bernardo Innocenti - http://www.codewiz.org/
\X/ One Laptop Per Child - http://www.laptop.org/
More information about the xorg
mailing list